markusk has asked for the wisdom of the Perl Monks concerning the following question:
It works, but only in a global scope. ie placing 'my' infront of $$_ breaks everything. Help would be appreciated. Thanks@names = ('peter','jonah','larry'); foreach (@names) { $$_ = "i like $_"; } print "$peter \n $jonah \n $larry \n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Assigning variables via looping
by gwadej (Chaplain) on Jun 02, 2009 at 19:48 UTC | |
by Errto (Vicar) on Jun 02, 2009 at 21:14 UTC | |
|
Re: Assigning variables via looping
by kennethk (Abbot) on Jun 02, 2009 at 19:46 UTC | |
|
Re: Assigning variables via looping
by eff_i_g (Curate) on Jun 02, 2009 at 20:52 UTC | |
by ikegami (Patriarch) on Jun 02, 2009 at 20:59 UTC |