Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Save Split to Array

by Grey Fox (Chaplain)
on Aug 28, 2009 at 16:05 UTC ( [id://791952]=note: print w/replies, xml ) Need Help??


in reply to Save Split to Array

spickles
A simpler way to do the for loop is to use the foreach.
my $str = "I'm not as think as you stoned I am"; # split into individual words on whitespace delimiter # and store in array @words my @words = split( /\s+/, $str ); foreach my $word (@words) { print "$word\n"; }
-- Grey Fox
"We are grey. We stand between the darkness and the light" B5

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-23 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found