in reply to Re: Stupid If Question
in thread Stupid If Question

Perl will translate the "/" to back slash when needed

I doubt it since the OS happily accepts "/" as a path separator.

While the following isn't proof, it would surprise most:

C:\Documents and Settings\ikegami>dir "c:/bin" Volume in drive C is C Volume Serial Number is 28AB-0E8B Directory of c:\bin 2008/12/21 10:53 PM <DIR> . 2008/12/21 10:53 PM <DIR> .. . . .

Replies are listed 'Best First'.
Re^3: Stupid If Question
by Marshall (Canon) on Aug 19, 2009 at 03:50 UTC
    There are differences in MS OS, consider:

    Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Projects>cd /temp The system cannot find the path specified. C:\Projects>cd \temp C:\TEMP>
    There can be weird things with "\". I am just saying for the most part, use "/" instead of "\\". I think we agree on that!

      There are differences in MS OS, consider:

      uh no. We're using the same OS. It seems you didn't execute the same command as I did.

      You need to use quotes since a bare "/" denotes an switch. And while some shell commands and utilities accept "/", chdir aka cd isn't one of them.

      Going back to what I said, the OS (WinXP) itself accepts "/" throughout its API. This is how Perl communicates with the OS, so it's free to use "/".

      There can be weird things with "\". I am just saying for the most part, use "/" instead of "\\". I think we agree on that!

      I made a comment on the text I quoted specifically. The advice you give is sound, although I use "\" personally. "/" just looks to weird.