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

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.

Comment on Re: arrays and foreach
Select or Download Code

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 making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2015-11-25 14:16 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (677 votes), past polls