Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

mrborisguy's scratchpad

by mrborisguy (Hermit)
on Dec 09, 2005 at 17:34 UTC ( [id://515600]=scratchpad: print w/replies, xml ) Need Help??

package Array::Map::OO; sub new { my $class = shift; bless [@_], $class } sub AUTOLOAD { my $self = shift; return if $AUTOLOAD =~ /::DESTROY$/; my @array; for ( @$self ) { eval { push @array, $_->$AUTOLOAD( @_ ); } if ( $! ) { warn $!; # actually, provide an option } } if ( wantarray ) { return @array; } else { return __PACKAGE__->new( @array ); } }

Now, if we can get children to return one of these instead of just an array, we can do something like:

my @grandchildren = $root->children->children;

But what about children_and_self? We'll be processing some things twice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2025-06-21 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.