Try this:
@array = qw (A B C D E F G); @array2 = map { sprintf("%s%d",$array[$_],$_+1) } (0..$#array);
Update:Corrected a mistake in my original code after actually shudder testing it.
| Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
| Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. | |
In reply to Re: prepend string to entire array
by blue_cowdawg
in thread prepend string to entire array
by mhearse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |