Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 meditating upon the Monastery: (3)
As of 2025-02-08 23:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (95 votes). Check out past polls.