Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: DIFFERENCE BETWEEN VARIABLE

by autark (Friar)
on Jan 31, 2001 at 18:36 UTC ( #55472=note: print w/replies, xml ) Need Help??


in reply to DIFFERENCE BETWEEN VARIABLE

Actually, there is a difference between $output and ${'output'}:
$output = "global"; { my $output = "my"; print $output; print ${'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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2020-12-01 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (11 votes). Check out past polls.

    Notices?