Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Choosing between multiple closures

by oakb (Scribe)
on Jun 12, 2014 at 07:22 UTC ( [id://1089654]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub increment {
        my ( $number, $incval )  =  @_;
    ...
    while ( my $result  =  $action->() ) {
        print "$result\n";
    }
    
  2. or download this
    sub do_something {
        my $action  =  shift( @_ );
    ...
    while ( my $result  =  $action->() ) { # <-- The error happens here
        print "$result\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1089654]
Approved by Ratazong
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found