in reply to Re^3: Trouble using a Win32 file path in an array
in thread Trouble using a Win32 file path in an array

[ In response to the update ]

there are a whole lot of Windows things between Win 3.1 and Win XP: Win 98, WinNT, Win2K. I was thinking more about NT and 2K when I made the comment about previous versions of windows.

Yes, except you talked of older versions where "/" wasn't accepted as a directory separator. I'm pretty sure none of those qualify.

sometimes the "forwards slash" works at the command line and sometimes it doesn't.

Yes, I mentioned that earlier in the thread, in addition to giving the reason and a workaround that works in most instances.

In an attempt to try and avoid confusion, when writing Perl, I always use forward slash.

Do you realize that Perl passes paths to Windows exactly as you provide them to Perl? It does NOT convert the slash first.

  • Comment on Re^4: Trouble using a Win32 file path in an array

Replies are listed 'Best First'.
Re^5: Trouble using a Win32 file path in an array
by Marshall (Canon) on Sep 30, 2009 at 23:22 UTC
    Ikegami, I found your comments helpful.

    As far as WinNT and W2K, I will plead probably too ignorant to have even tried using forward slash on the command line. I don't remember forward slash working but that may be because I just never tried as part of usual practice.

    Maybe you can shed some light on the following...I am not sure why your "type" command works and mine doesn't! This doesn't appear to be a "syntax error". "cat" works on my system, but I have cygwin installed. I don't know why "type" can't find the file specified, but yet "cat" can.

    C:/TEMP/comment.txt #I know from experience that I can open this #filepath with Perl on Win XP and read it. C:\Projects>type C:/TEMP/comment.txt The syntax of the command is incorrect. C:\Projects>type "C:/TEMP/comment.txt" #doesn't work The system cannot find the file specified. #my command above looks similar to yours, but doesn't appear #to work for unknown reasons...your command works.... >type "c:/documents and settings/ikegami/bar.txt" foo C:\Projects>type 'C:/TEMP/comment.txt' #did work either The syntax of the command is incorrect. #but I didn't expect it to. C:\Projects>cat C:/TEMP/comment.txt (this works)

      Are you getting getting the builtin type or something else?

      Update: It's messed!

      C:\Documents and Settings\ikegami>copy nul "c:/documents and settings/ +ikegami/bar.txt" C:\Documents and Settings\ikegami>type "C:/documents and settings/ikeg +ami/bar.txt" C:\Documents and Settings\ikegami>cd\ C:\>type "C:/documents and settings/ikegami/bar.txt" The system cannot find the file specified.