Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: while loop

by blazar (Canon)
on Apr 26, 2006 at 09:10 UTC ( #545732=note: print w/ replies, xml ) Need Help??


in reply to Re: while loop
in thread while loop

Well, quite about the only answer that such a question deserves. But while you're there, and the op is clearly a newbie, please do not use the &-form of sub call, since we take care all the time of deprecating it to avoid this cargo-culted remnant from Perl 4 to spread further. If you want to underline that you're doing a sub call, then you may use empty parens...


Comment on Re^2: while loop
Download Code
Replies are listed 'Best First'.
Re^3: while loop
by mantadin (Beadle) on Apr 26, 2006 at 10:12 UTC
    Thanks for the info; I did not know that the &-form is considered a cargo-culted remnant.

    OTOH, I am not aware of the &-form having any useful advantage. AFAIK, &f, if called from within another sub, is equivalent to f(@_) "but faster", as the camel books states (3rd edition, Chapter 6, scoping issues).

      Well, perldoc perlsub explains it all. In brief, do not use the &-form unless you know what you're doing, i.e. either circumvent prototypes, if you're giving an explicit arg list or make current @_ visible to the sub, as you say.

        ... or when dereferencing a CODEREF or a symbolic reference to a subroutine name, or taking a reference to a subroutine, or when using the subroutine as an argument to goto ...

        /J\

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-07 19:09 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 (93 votes), past polls