Your split is useless. You're pushing eleven distinct elements onto the array, and you're iterating over them one at a time. Print $_ within your loop to see that.
(You can also print your array with Data::Dumper.)
You could instead concatenate the array elements together with . instead of ,, but you're better off using an anonymous array and avoiding the split altogether. (What happens if one of the textual elements contains a semicolon?)
Improve your skills with Modern Perl: the free book.
In reply to Re: arrays and foreach
by chromatic
in thread arrays and foreach
by fritz1968
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |