in reply to Re: Creating a new file in a directory
in thread Creating a new file in a directory

P.S.: You are using UNIX-Style forward slashes on a Windows-Platform: D:\.../file_detail.txt You probably want to fix that.

The Windows "kernel" accepts forward slashes as well as back slashes as directory delimiters. The forward slash is usually only a problem with command line applications (and cmd.exe) which expect options to be introduced by forward slash.

However, Unix, Linux and related OSs do not accept back slash as directory delimiters. Also, there are other OSs use other characters and do not accept either back or forward slashes as directory delimiters.

  • Comment on Re^2: Creating a new file in a directory

Replies are listed 'Best First'.
Re^3: Creating a new file in a directory
by Monk::Thomas (Friar) on Aug 24, 2015 at 08:15 UTC

    This (and Anonymous') is a typical technical answer. Totally correct but both of you fail to consider the actual user. The filename is presented to the user as part of an error message. Wouldn't it be a lot more user friendly if the program shows the filename in native format? That way the user doesn't have to concern itself with what's going on behind the scenes.

    Also, there are other OSs use other characters and do not accept either back or forward slashes as directory delimiters.

    I am totally aware of that and I am quite fond to let Path::Class handle that for me. However it's a bit besides the point. The OP did not imply that the program was running on any other OS besides Windows.