dynamically substituting variable name

M

mostart

hi,

I want to dynamically substitute a variables name.
I know this from PHP where you can have somthing like
${$foo}

how can I do this in perl ??

thanks
mostart
 
J

Jürgen Exner

mostart said:
I want to dynamically substitute a variables name.
I know this from PHP where you can have somthing like
${$foo}

how can I do this in perl ??

You may want to check The Fine Manual about why it's a bad idea to use
symbolic references and what better options are available: perldoc -q
'variable name'

How can I use a variable as a variable name?
Beginners often think they want to have a variable contain the
name of a variable.
[...]
This works *sometimes*, but it is a very bad idea for two
reasons. [...]

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top