Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: getting the name of a variable to use as string

by sintadil (Pilgrim)
on Sep 17, 2004 at 01:21 UTC ( [id://391631]=note: print w/replies, xml ) Need Help??


in reply to getting the name of a variable to use as string

What you want is a symbolic reference. For most purposes, they're not needed in Perl. You can often accomplish what you want from symbolic references with other means. Perhaps you can specify why you think you need one?

  • Comment on Re: getting the name of a variable to use as string

Replies are listed 'Best First'.
Re^2: getting the name of a variable to use as string
by tilly (Archbishop) on Sep 17, 2004 at 01:31 UTC
    A symbolic reference will not accomplish what he's looking for. The symbolic reference mechanism only accesses package globals. The variable that he's going to wind up accessing dynamically is a lexical.

    I agree that the problem "smells wrong" though, and the need should probably be rethought.

      A symbolic reference will not accomplish what he's looking for. The symbolic reference mechanism only accesses package globals. The variable that he's going to wind up accessing dynamically is a lexical.

      sintadil RTFMs. I see. Thanks for the clarification.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found