Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

cleverett's scratchpad

by cleverett (Friar)
on Mar 08, 2010 at 20:41 UTC ( #827429=scratchpad: print w/replies, xml ) Need Help??

sub produce { my ( $pkg, @args ) = @_; my %args = %{ {@args} }; my $type = delete $args{type} || q{}; my %attr = %{ delete $args{attrs} || {} }; my ( $item_module, $item_class ) = $pkg->find_product( $type, %att +r ); if ( !exists $already_required{$item_class} ) { ## compile inside eval, so we get a real error message at leas +t once local $EVAL_ERROR = q{}; my $is_compiled = eval { require $item_module; return 1; }; if ( !$is_compiled ) { $EVAL_ERROR ||= 'Unknown error'; confess "$item_module didn't compile: $EVAL_ERROR"; } # track already compiled classes my @parents; { no strict 'vars'; *parents = *{"$item_class\::ISA"}{ARRAY}; } foreach my $p (@parents) { next if ! $p =~ m/^TDP::/; $already_required{$p} = ++$counter } $already_required{$item_class} = ++$counter; } return $item_class->new(%args); }
Log In?

What's my password?
Create A New User
[LanX]: but I don't understand the question...
[GotToBTru]: okay, I see what it does
[GotToBTru]: you;ve answered it .. the expression is meant to be evaluated as written, it is not a symbol for a special operation
[LanX]: '&;@' is a parsing error
[GotToBTru]: by itself, yes, but used in sub pre(&;@) not so
[LanX]: &; is interpreted as a function call, but the @ has no meaning
[LanX]: OH
[LanX]: you are talking about signatures?
[GotToBTru]: yes, it turns out I am
[LanX]: http://perldoc. html#Prototypes

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-01-18 21:08 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (164 votes). Check out past polls.