There's more than one way to do things | |
PerlMonks |
Re: DIFFERENCE BETWEEN VARIABLEby autark (Friar) |
on Jan 31, 2001 at 18:36 UTC ( [id://55472]=note: print w/replies, xml ) | Need Help?? |
Actually, there is a difference between $output
and ${'output'}:
This little example will first print out "my" then "global". This is because the latter is a symbolic reference to the $output variable - hence it will always refer to the global variable (which is stored in the package stash). ${output} on the other hand is not a symbolic reference, and will still refer to the lexical variable (if one exists). Autark.
In Section
Seekers of Perl Wisdom
|
|