Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by kvale (Monsignor)
on Oct 26, 2004 at 15:56 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-24 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found