#!/usr/bin/perl -w ###-DDEBUGGING -d -Dslt` use Env; use English ( no_match_vars ); local $INPUT_RECORD_SEPARATOR; my $searchPattern = "(^\#!/usr/bin/perl.*?\n)"; my $insertion = "\nuse English \( no_match_vars \);\n"; #my $content = "#!/usr/bin/python\n"; my $content = "#!/usr/bin/perl\n"; print "content = \n$content \n"; print "insertion = \n$insertion \n"; $content =~ s?${searchPattern}?${1}${insertion}?xmsp; print " content now = \n$content \n"; exit 0;