Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Can I concatenate variables?

by LanX (Chancellor)
on Jan 26, 2013 at 19:58 UTC ( #1015534=note: print w/replies, xml ) Need Help??


in reply to Can I concatenate variables?

> Is it impossible to use variables within variables?

Yes, but for good reasons "symbolic references" are deactivated under strict!

Better use hashes:

my %line; for my $alpha ( "a" .. "b" ) { $line{$alpha} = "somenum"; }

If you still insist to use it, search for "variables as variable names perl".

EDIT: second google hit Why it's stupid to `use a variable as a variable name' from 1998!!! =)

Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015534]
help
Chatterbox?
[stevieb]: I have learned that my daughter has significant brain injury, so that's affecting my decisions. Don't know who to reach out to. I just want to vent. I am honestly lost. It's something I can't code around.
[stevieb]: I am infuriated at the same time I am hopeless. It appears there are approaches to 'fix' things, but, you know..,

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-02-25 04:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (365 votes). Check out past polls.