yams has asked for the wisdom of the Perl Monks concerning the following question:
I would like to be able to store the variable names in an array, ie.while (<DATA>) { ($name[$b],$address[$b],$city[$b],…) = split /\,/,$_; etc... $b++; }
and then somehow use this array of names to work with the split command in the same way as above. Any ideas? Thanks in advance.@varnames =(‘name’,’address’,’city’,…)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using variable names from an array
by lhoward (Vicar) on Sep 05, 2000 at 00:47 UTC | |
|
(Ovid) Re: Using variable names from an array
by Ovid (Cardinal) on Sep 05, 2000 at 01:05 UTC | |
|
Another approach
by gryng (Hermit) on Sep 05, 2000 at 08:27 UTC |