#!/opt/perl5/bin/perl5.005 -w use strict; use warnings; $|++; ## process each file passed on command line for my $file ( @ARGV ) { ## open the file for reading open( RC => "<", $file ) or die "Can't open $file"; ## print the program name and current file to be processed print "$0: $file\n"; ## print errors and warnings while() { print if /error|warning/i } close RC; }