Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^8: Line numbers

by LanX (Saint)
on Mar 19, 2012 at 18:22 UTC ( [id://960456]=note: print w/replies, xml ) Need Help??


in reply to Re^7: Line numbers
in thread Line numbers

Because parens around sub-args are optional.

print '', (caller(0))[0]; means print ( '', (caller(0))[0] );

But providing explicit parens after a sub-name will disable automatic grouping of args.

Cheers Rolf

Replies are listed 'Best First'.
Re^9: Line numbers
by gg48gg (Sexton) on Mar 19, 2012 at 19:02 UTC

    Ahhh, I think I understand. That is why this does work, right?

    print ((caller(0))[0]);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-16 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found