in reply to grabbing info from log after key word

#!/usr/bin/perl if( $ARGV[0] ){ $filename=$ARGV[0]; }else{ print "USAGE: getUserAgent <logfile name>\n"; exit; } open FILE,"</path/$filename" or die "Can't open /path/$filename becaus +e $!"; $over=0; while( <FILE> ){ if( m/\b(Mozilla\b.*)/ ){ print "$1\n"; $over++ if( (length $1) > 100 ); } } print "$over over 100\n";

Replies are listed 'Best First'.
Re: Re: grabbing info from log after key word
by edmay98 (Novice) on Jan 03, 2001 at 21:58 UTC
    Thanks 10, you oh so honorable monk. I tried this and it worked great. May the new year bring you happiness, joy and plentiful amounts of excellent grog.