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 drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-08-01 15:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (28 votes), past polls