#!/usr/bin/perl use strict; use warnings; my $HSSIN='D:\testproject\HSS-export-test-run-small.txt'; my $ofile = 'D:\testproject\HSS-output.txt'; open (INFILE, $HSSIN) or die "Can't open input file"; open (OUTFILE,"> $ofile" ) or die "Cant open file"; my $content = undef; {undef $/; $content = } close(INFILE); my $num_found = 0; while( $content =~ /\t*CF=(CFU-TS10-ACT-(NONE|\d+))/g ){ $num_found++ } print "multiple cases: $num_found cases of ... " if $num_found > 0; ...