Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: use of $sub

by JimLS (Novice)
on Oct 19, 2012 at 15:57 UTC ( [id://999962]=note: print w/replies, xml ) Need Help??


in reply to Re^3: use of $sub
in thread use of $sub

Not, "$" but "$!".

No, I don't mean "$!". I looked up "$!" and understood that. I mean the addition of "$" to "SUB" resulting in "$SUB".

Replies are listed 'Best First'.
Re^5: use of $sub
by tobyink (Canon) on Oct 19, 2012 at 16:09 UTC

    Oh OK. $SUB is just a variable... same idea as $TUB or $PUB or $RUB... nothing special. In this case it's undefined, so when interpolated into the string doesn't do anything.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
      I could be way off base but I was thinking that $SUB (or SUB) was used in an attempt to report where in the program/which subroutine the error occured and was a predefined thing. If not, it must have been set in other parts of the program that this chunk of code may have been pulled out of. In any case I don't need it and will delete it. Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found