Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Welcome to the Monastery
 
PerlMonks  

Re: using a string as a SCALAR ref while "strict refs" in use

by tobyink (Prior)
on Jun 19, 2012 at 11:28 UTC ( #977033=note: print w/ replies, xml ) Need Help??


in reply to using a string as a SCALAR ref while "strict refs" in use

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.

no 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'


Comment on Re: using a string as a SCALAR ref while "strict refs" in use
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2013-05-21 10:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (431 votes), past polls