open (SYST, "$upload_dir/$filename"); while (defined ($line = )) { next if ($line =~ /^\s+/) ; if ($line =~ /"(.*)"/) { print "found line= $line\n"; $line =~ s! "(.*)" ! (s/,/sprintf("_", $&)) !ee; print "now line= $line\n"; } } close (SYST);