Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Regular Expression Question

by Masem (Monsignor)
on Mar 27, 2001 at 21:30 UTC ( [id://67551]=note: print w/replies, xml ) Need Help??


in reply to Regular Expression Question

OOTOMH...
while (<FILE>) { my $boxname; if ( ! ( /^Filesystem/ ) ) { $boxname = $_; } else { while (<FILE>) { my ( $title, $blocks, $used, $avail, $percent, $mounted ) += split /\s+/; last if ( !defined( $title ) ); my $number = ( $percent =~ /(\d*)\%/ ); if ( $number > 88 ) { print "$boxname's $title is at $percent!\n"; } } } }

Update Should be split \/s+\ rather than \/s*\


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: Re: Regular Expression Question
by MrNobo1024 (Hermit) on Mar 27, 2001 at 21:45 UTC
    Did you mean split(/\s+/)? split(/\s*/) will split it into individual characters because /\s*/ can match a 0 character string.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2025-07-20 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.