#! /usr/local/bin/perl if ($ARGV[0]) { foreach $line (@ARGV) { if ($line ne '') { chop $line; $line =~ m/([0-9]+)\%/ ; if (length($1)>0) { $loss="$1\%"; if ($1 < 100) { print 1; exit 1; } else { print 0; exit 0; } } } } } print "notfound"; exit 1; __END__