Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Errors in File::Recurse()?

by lolindrath (Scribe)
on Nov 10, 2000 at 02:13 UTC ( #40832=note: print w/replies, xml ) Need Help??


in reply to Errors in File::Recurse()?

Windows paths in perl must look like this:
"c:\\folder\\folder"

Those crazy DOS people.

--=Lolindrath=--

Replies are listed 'Best First'.
RE: Re: Errors in File::Recurse()?
by myocom (Deacon) on Nov 10, 2000 at 02:16 UTC
    Actually, that's not-so-much true. Within Perl (and really, for many Win32 functions), 'c:/folder' is perfectly valid.
RE: Re: Errors in File::Recurse()?
by Fastolfe (Vicar) on Nov 10, 2000 at 02:20 UTC
    Or 'c:\folder\folder'. You only need to escape the back-slashes when you use them together (so you can still escape '): '\\\\server\share\dir\jack\'s file'
      Hehe...well, the unexpected behavior in this situation is that if you use a function that evaluates the path string and the first letter after a single backslash is an 'n' or some other command (e.g.: \n, etc.) then it evals that command and craps out your function. Forwardslash works fine on Win2k, dunno about other M$ products.

        Any function that "evalutates the path string" is pretty much broken in my book. Perhaps you could give us an example here. I suspect you might be confused as to how Perl deals with strings.

        Also, one other case where you need to double your backslash inside of single quotes (or the q{} operator) is if you want a backslash at the end of the string. I find not doubling your backslashes inside of single quotes to be a bad habit that leads to forgetting to double them in the cases when you need to (which leads to strange errors that can be very hard and time-consuming to find) and so I say always double your backslashes in single quotes.

        BTW, it would have been much nicer if single quotes had been defined so that you double the delimiter to include it in the string (like 'should''ve'). Then backslash would have no special meaning inside single quotes (unless you used it as the delimiter like q\this\). But it is too late to change that now.

                - tye (but my friends call me "Tye")

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://40832]
help
Chatterbox?
[choroba]: The problem was bigger, as the test tried to call a method that didn't exist anymore
[marinersk]: :: ducking ::
[choroba]: because, someone renamed the method, but didn't notice it was used in the test, as the test was skipped
[marinersk]: Well, if the method doesn't exist, it would be hard to pass the test.
[choroba]: later, someone removed the new method, as all its usage places were safe, but didn't notice the test still used the old name
[choroba]: fortunately, it wasn't that hard to replace the method and fix a few remaining failures due to the changes we did to the codebase over the years
[marinersk]: choroba Sounds like a process improvement opportunity; tests may not all need to be run, but they should all be compiled with perl -c before check-in/promotion happens.
[choroba]: so, now I have the test, so I can start making changes in the code. Back to the original ticket, yay!
[marinersk]: I definitely love it when my $current_taask=& taskPop(); if ($current_task eq $original_task) { } is true.
[marinersk]: s/taask/task/g;

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2017-05-25 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?