Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Another question about the split function

by FunkyMonk (Chancellor)
on Dec 11, 2007 at 23:10 UTC ( [id://656510]=note: print w/replies, xml ) Need Help??


in reply to Another question about the split function

If you're having a problem with split, the official documentation is the first place to look. You can access it...
  • from the command line by typing perldoc -f split (*nix and Windows)
  • in HTML (ActivePerl on Windows) via start-->Programs-->ActivePerl-->Documentation
  • by typing doc://split into the PerlMonks search box
  • by Googling for perldoc split.

Any of the links I've posted will also take you there.

Anyway, split says (with my emphasis)...

If EXPR is omitted, splits the $_ string. If PATTERN is also omitted, splits on whitespace (after skipping any leading whitespace)

and ...

As a special case, specifying a PATTERN of space (' ' ) will split on white space just as split with no arguments does
So, all you need to do is
my @statusLineFields = split(' ', $statusLine);

Replies are listed 'Best First'.
Re^2: Another question about the split function
by pfaut (Priest) on Dec 11, 2007 at 23:16 UTC
    If EXPR is omitted, splits the $_ string. If PATTERN is also omitted, splits on whitespace (after skipping any leading whitespace)
    As a special case, specifying a PATTERN of space (' ' ) will split on white space just as split with no arguments does

    Those little factoids escaped me. I suppose it's time to start reading 'Programming Perl' for the third (or is it fourth?) time. No matter how many times I read it I always pick up something new

    90% of every Perl application is already written.
    dragonchild

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-24 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found