kvtan has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a script and will package it using PP to distribute to users that don't have Perl installed on their PCs.
The script should save a file in the current directory. This is all well and good if I run it from the command prompt, but if I were to double click it after compiling it into an executable, it will then save it to "C:\Documents and Settings\User\".
I've tried using getcwd to get the current directory, but it appears to be getting the current WORKING directory, so instead of "C:\Perlworks" it still gets "C:\Documents and Settings\User\".
I suppose I could hard-code the save directory, but this seems a bit inelegant. Any ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Current Directory in Windows
by Corion (Patriarch) on Mar 09, 2012 at 14:39 UTC | |
by Anonymous Monk on Mar 09, 2012 at 14:56 UTC | |
by Anonymous Monk on Mar 09, 2012 at 15:02 UTC | |
|
Re: Current Directory in Windows
by BrowserUk (Patriarch) on Mar 10, 2012 at 13:38 UTC | |
|
Re: Current Directory in Windows
by Marshall (Canon) on Mar 09, 2012 at 17:53 UTC | |
by Anonymous Monk on Mar 10, 2012 at 12:21 UTC | |
by Marshall (Canon) on Mar 10, 2012 at 12:29 UTC | |
by Anonymous Monk on Mar 10, 2012 at 10:23 UTC | |
|