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

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'

Replies are listed 'Best First'.
Re^6: use of $sub
by JimLS (Novice) on Oct 19, 2012 at 17:03 UTC
    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!