ShermW0829 has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to use a loop to create variables such as $line_a, $line_b but use a variable to do that. So if I say:
foreach $alpha ( a .. b ) { $line_$alpha = "somenum"; }
I get an error. I have tried the dot notation. Is it impossible to use variables within variables?
Thanks in advance;
Sherman
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Can I concatenate variables?
by LanX (Saint) on Jan 26, 2013 at 19:58 UTC | |
Re: Can I concatenate variables?
by AnomalousMonk (Archbishop) on Jan 27, 2013 at 00:02 UTC | |
by ShermW0829 (Sexton) on Feb 23, 2013 at 22:30 UTC |
Back to
Seekers of Perl Wisdom