bsdz has asked for the wisdom of the Perl Monks concerning the following question:
I would like something like $LIST_INDEX to exist. Is there an alternative concise way of doing what I would like to do?my @f = ('%s', '%.2f', '%u','%d'); my @d = ('my string', '123456.54321' ,'1234.4321' , '1234'); my @D = map { sprintf($f[$LIST_INDEX], $_) } @d; print @D,"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Is there an equivalent $. for lists or arrays in map or foreach?
by merlyn (Sage) on Sep 16, 2004 at 16:55 UTC | |
by bsdz (Friar) on Sep 16, 2004 at 17:01 UTC | |
|
Re: Is there an equivalent $. for lists or arrays in map or foreach? (mapcar!)
by tye (Sage) on Sep 16, 2004 at 18:36 UTC |