go ahead... be a heretic | |
PerlMonks |
Re: Re: Re: Re: Runtime Hash Variable accessby Juerd (Abbot) |
on Mar 08, 2004 at 15:04 UTC ( [id://334833]=note: print w/replies, xml ) | Need Help?? |
What I was doing in my reply is called a sumbolic reference? Symbolic, yes. And that is deprecated? No, just frowned upon. I think it's quite a nice way of getting the value of a variable which name you don't yet know. It's not. It requires global variables, which suck (see Coping with Scoping) and makes debugging hard. Instead, just use a hash (forget for a moment that the stash is a hash, if you knew that). Your code, using a hash and strict, would be: See also Why it's stupid to `use a variable as a variable name'. Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }
In Section
Seekers of Perl Wisdom
|
|