use strict; { local $/ = undef; # Slurp mode my $file = ; my $html = $file=~s/\.html 200//g; print "Count of HTML 200 is $html\n"; }