in reply to / to \ substitution

Can you post more of your code? I don't see anything here that would cause the the problem you're having.

Is this a CGI script? Are you using CGI.pm? Have you tried running it from the command line?

Replies are listed 'Best First'.
RE: Re: / to \ substitution
by NeverMore (Acolyte) on May 31, 2000 at 07:30 UTC
    That's about it. I am using CGI.pm. You can do something as simple as this and see the problem
    use CGI qw(:all); $file2 = param('file') unless $debug; print "$file2\n"; $file2 =~ s[\\][/]g;
    Then you can do "perl foobar.pl file=c:\foo\bar.txt". Observe what happens. -NM
      Actually, try this as well:
      use CGI qw(:all); $debug = 1; $file2 = param('file') unless $debug; $file2 = 'c:\foo\bar.txt' if $debug; print "$file2\n"; $file2 =~ s[\\][/]g;
      This debug thing really was a neat thing, btw.

      -NM

        I must be missing something, because I don't see what the problem is. The substitution is working correctly, as you will see if you add a second print "$file2\n"; at the end. What is it that you are trying to achieve?

        --ZZamboni