Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 ( [id://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?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-04-25 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found