in reply to DIFFERENCE BETWEEN VARIABLE
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 = "global"; { my $output = "my"; print $output; print ${'output'}; }
${output} on the other hand is not a symbolic reference, and will still refer to the lexical variable (if one exists).
Autark.
|
|---|