use CGI qw(:all); $file2 = param('file'); # If c:\foo\bar.txt is filled in the form field named 'file'... print "$file2\n" # c:foobar.txt is printed, when c:\foo\bar.txt should be! $file2 =~ s[\\][/]g; # Too late to substitute print "$file2\n" # c:foobar.txt is still printed when c:/foo/bar.txt should be!