Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: / to \ substitution

by comatose (Monk)
on May 31, 2000 at 07:10 UTC ( [id://15570]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://15570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-24 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found