This is Perl.
However, to learn how to do so (we are here, after all, to help you learn, not to do it for you), I would suggest push. Using the example there, you could create an array with elements 0, 2, 4 ... containing the "@char\d" and the odd-numbered elements with the data. Alternately (and perhaps better), see the Tutorials on hashes, here in the Monastery
...just for starters, that is.
In reply to Re^5: foreach loop
by ww
in thread foreach loop
by morio56
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |