my $count = ($line =~ s/[#] .*? \n//xms); $total += $count; #### $line =~ s/["'] [^'"\n] ['"]//gxms #### $count = ($line =~ s/use [^;]+ ;//gxms); $total += $count; #### my $count = ($all_text =~ s/<<(\w+) .*? \1//gxms); $total += $count; #### $total++ if $all_text =~ s/(__DATA__|__END__) .*//xms;