Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by pg (Canon)
on Oct 26, 2004 at 16:21 UTC ( #402682=note: print w/replies, xml ) Need Help??


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

chomp is not needed here, you can see this through this demo:

use Data::Dumper; use strict; use warnings; $_ = "1 2\n3\t4\r\n5\n"; my @words = split; print Dumper(\@words);

It gives you:

$VAR1 = [ '1', '2', '3', '4', '5' ];

Log In?
Username:
Password:

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

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



    Results (98 votes). Check out past polls.

    Notices?