Object-InsideOut - Re: :Restricted methods imported into child classes?

Posted on Tue Jan 24 23:29:27 2006 by je44ery in response to 1652 (See the whole thread of 9)
Re: :Restricted methods imported into child classes?
I now have this working swimmingly. I am using it for the 'Type' subroutines in the %init_args hash mostly.
$ cat Top.pm package Top; use Object::InsideOut 'Exporter'; BEGIN { our @EXPORT_OK = qw(_check_foo); } sub _foo : Restricted { return 1; } 1;
$ cat Top/Middle.pm package Top::Middle; use Object::InsideOut 'Exporter', 'Top' => [ qw(_check_foo) ],; BEGIN { our @EXPORT_OK = qw(_check_foo); } my @info :Field('Standard' => 'info'); my %init_args :InitArgs = ( 'INFO' => { 'Type' => \&_check_foo, 'Field' => \@info, }, ); 1;
$ cat test_export.pl #!/usr/bin/perl -w use strict; use warnings; use Top::Middle; my $obj = Top::Middle->new( 'info' => 'some_data_or_whatever' ); exit 0;
Write a response