Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Can I concatenate variables?

by LanX (Canon)
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


Comment on Re: Can I concatenate variables?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (18)
As of 2015-07-01 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (16 votes), past polls