#!iw-home/iw-perl/bin/iwperlmy $fname = shift;my $from = shift;my $to = shift;$marker="SOME_DCR_INFO";# You declared some variables with my, why not the others?$lookingfor=$marker.$from;$replacewith=$marker.$to;# [nit] 'marker' should probably be renamed to 'context'if (-B $fname){ # print "$fname is binary - not changing\n"; exit(0); # see note '1' after code}open(IN, "<$fname") || die " '$fname' ($!)"; # see note '1'my @text = map { $happened = s/$lookingfor/$replacewith/; $_;# I do not think the above code is written correctly # It is a bit obfuscated, but I think you want the '=' to be '+=' # and you should initialize $happened to 0 beforehand # [nit] 'happened' should probably be renamed to 'changed'} <IN>;close(IN);#print "Processed $fname\n";if ($happened) { print "Changed file $fname\n"; open(OUT, ">$fname") || print "Cannot write to $fname\n"; # see note '2' print OUT @text; close(OUT);}