Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I had build a simple perl application and it run sucessfully. But currently as I compile it using perl2exe, it will run on a command prompt(dos prompt). I am having a problem that, when the application is place in desktop, it will say could not detect c:/document. As I am using WindowXP, dos could not read the space between c:/document setting/.. How to fix this problem.

And how do make an application that execute normally on window like other application without going to command prompt.

Thanks

Retitled by davido.

Replies are listed 'Best First'.
Re: perl2exe and spaces in paths
by Errto (Vicar) on Jan 15, 2005 at 05:51 UTC

    To answer your second question, perl2exe has a -gui option that causes your compiled .exe not to create a console when it runs. Note that I found this in the perl2exe manual.

    For the first one, I'm not entirely sure, but my first guess is that it's a code issue. If you could post the source code for a small program that demonstrates this issue and the exact error message that would be helpful.

Re: perl2exe and spaces in paths
by holli (Abbot) on Jan 15, 2005 at 07:30 UTC
    XP has normally no problems with spaces in paths, however you could try to put the errorneous path in double-quotes, eq:
    $path = "\"c:/document setting/...\"";
    if that doen´t work, post your code.

    holli, regexed monk
Re: perl2exe and spaces in paths
by dimar (Curate) on Jan 16, 2005 at 02:07 UTC

    Errto answered your second question, and holli answered your first. The only other tidbit left to mention (other than reiterate that you should post your code to avoid people having to 'guesstimate') is this:

    If doublequoting your paths does not work, there is probably a line in your code that is calculating the current working directory relative to whever the script (or exe file) is placed. To check this, try running your script from a path that you are certain contains no spaces in the path, then move it to one that does contain spaces. If there is a difference, then you have found the problem.

    Normally WinXP can handle paths with spaces in the name, but that still does not save the day if you are passing that path to an external process or cmd prompt utility, or any of the other myriad sources that do not handle spaces as you might expect.