Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987834]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2016-12-03 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (52 votes). Check out past polls.