Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: How do I write subs that take bare blocks as args?

by Courage (Parson)
on Jun 28, 2002 at 06:37 UTC ( #177950=note: print w/ replies, xml ) Need Help??


in reply to Re: How do I write subs that take bare blocks as args?
in thread How do I write subs that take bare blocks as args?

Among those two calls of &$test they are almost equivalent, and first one will trap any errors, so you can later check $@ variable to see if subroutine died. Like "try" in C++.

OTOH my personal preference is to call anonymous sub as

$test->(); $test->('arg1',$arg2);

Courage, the Cowardly Dog.
PS. Something fishy is going on there, or my name is Vadim Konovalov. And it's not.


Comment on Re: Re: How do I write subs that take bare blocks as args?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://177950]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2014-08-31 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls