|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: using a string as a SCALAR ref while "strict refs" in useby tobyink (Prior) |
| on Jun 19, 2012 at 11:28 UTC ( #977033=note: print w/ replies, xml ) | Need Help?? |
|
You can't use a string as a reference while strict refs is in use. That's the whole point of strict refs. If you want to use a string as a reference, you should disable strict refs.
Your question is a bit like asking, "I've put up a sign on my front gate which says 'No Dogs Allowed'. Now I can't let my dog into my garden. How do I let my dog into my garden?" If you want to use non-strict references, don't put up a sign (use strict) that says only strict references are allowed.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||