Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Splitting without losing

by Kanji (Parson)
on Jan 31, 2003 at 02:37 UTC ( [id://231498]=note: print w/replies, xml ) Need Help??


in reply to Splitting without losing

Rather than split, I'd be more inclined to use a simple regex...

my $line = 'Filesystem 1K-blocks Used Available Use% +Mounted on'; my @fields = $line =~ /(\s*\S+)/g; print "[", join( "][", @fields ), "]\n"; __END__ [Filesystem][ 1K-blocks][ Used][ Available][ Use%][ Mou +nted][ on]

    --k.


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-28 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found