Acme-RPC
view release on metacpan or search on metacpan
lib/Acme/RPC.pm view on Meta::CPAN
for my $k (keys %{$package.'::'}) {
next if $k =~ m/[^\w:]/;
next if $k =~ m/^_/;
next if exists $node->{$k}; # XXX $node->{$class}{chr(0)} could probably point to the correct stash or something
next unless *{$package.'::'.$k}{CODE};
reg( $node->{$k.'()'}{chr(0)} = sub { $object->can($k)->($object, @_); } ); # XXX hackish
# not recursing into the coderef here; if the sub is found hanging off of a stash, we'll recurse into it then.
}
}
} elsif(ref($object) eq 'HASH') {
# either our parent knows our name and did $node->{whatever} = caller_cv($ref), or else they made something up for us.
reg( $node->{chr(0)} = $object );
} elsif(ref($object) eq 'ARRAY') {
reg( $node->{chr(0)} = $object );
} elsif(ref($object) eq 'SCALAR') {
# a scalar... if it's not a ref, this node will get one item put in it; otherwise, it may get many.
# each of these can put whatever they want into $node!
# the above is a bit strange in trying to fill in child nodes as well as the node itself... it should probably be recursing. XXX
reg( $node->{chr(0)} = $object );
my $scalarcontains = $$object;
if(ref($scalarcontains) and ref($scalarcontains) ne 'SCALAR') {
( run in 0.229 second using v1.01-cache-2.11-cpan-4d50c553e7e )