dushyant has asked for the wisdom of the Perl Monks concerning the following question:
I want to do string concatenation on the left side of the assignment operator (=) to build variable name. Below concatenation is not working; but by looking at it, you can get the idea what I am trying do.
for ( $a = 1; $a <= 10; $a++) { $('var_' . $a) = 5 + $a ; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Concatenation on Variable Name
by toolic (Bishop) on Oct 17, 2012 at 17:21 UTC | |
by dushyant (Acolyte) on Oct 17, 2012 at 17:46 UTC | |
Re: Concatenation on Varibale Name
by davido (Cardinal) on Oct 17, 2012 at 17:42 UTC | |
Re: Concatenation on Varibale Name
by aitap (Curate) on Oct 17, 2012 at 17:59 UTC | |
Re: Concatenation on Varibale Name
by betterworld (Curate) on Oct 17, 2012 at 17:42 UTC | |
Re: Concatenation on Varibale Name
by dushyant (Acolyte) on Oct 17, 2012 at 18:11 UTC |
Back to
Seekers of Perl Wisdom