Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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?
[holli]: i saw that thread and figured it`s OPP value too high. i didnt realise its PM code
[LanX]: its the style attribute, I can't show you pm code, can only link to old everything docs of you want
[holli]: i'd like to keep my sanity, tyvm
[holli]: at least what's left off it :)
[LanX]: the+everything+ bible

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-11-20 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (294 votes). Check out past polls.

    Notices?