Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: arrays and foreach

by chromatic (Archbishop)
on Aug 16, 2012 at 17:14 UTC ( #987834=note: print w/replies, xml ) Need Help??

in reply to arrays and foreach

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987834]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2016-10-25 07:41 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.