Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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.

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 contemplating the Monastery: (4)
As of 2016-10-01 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (7 votes). Check out past polls.