in reply to Regular Expression Question
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*\
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regular Expression Question
by MrNobo1024 (Hermit) on Mar 27, 2001 at 21:45 UTC |