Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 rifling through the Monastery: (9)
As of 2015-07-02 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (29 votes), past polls