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!