Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How do you place words from a sentence into an array?

by kvale (Monsignor)
on Oct 26, 2004 at 15:56 UTC ( #402662=note: print w/replies, xml ) Need Help??


in reply to How do you place words from a sentence into an array?

Use split to break the sentence into words:
open FILE, "bingo_in.txt"; while (<FILE>) { my @words = split; }
This form of split uses the defaults of splitting $_ and using whitespace as a delimiter.

-Mark

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2022-05-28 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (99 votes). Check out past polls.

    Notices?