in reply to Re: / to \ substitution
in thread / to \ substitution

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

Replies are listed 'Best First'.
RE: RE: Re: / to \ substitution
by NeverMore (Acolyte) on May 31, 2000 at 08:02 UTC
    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