use warnings; use strict; my $file = $ARGV[0]; open my $fh, '<', $file or die "$file: $!"; while (<$fh>) { if ( (/test/..0) eq '1' ) { print "start\n"; } } close $fh;