seigniory has asked for the wisdom of the Perl Monks concerning the following question:
Nothing special, right? Well, the INI file is created in the directory that the user was in at the time, not necessarily the same directory as the script. i.e. if the script is located at c:\scripts\script.pl and I make the following call from the D:\> promptopen (INI, '>config.ini'); print INI "data:user_input"; close INI
if I could get the path of the script into $scriptPath. However, I don't know how to do this. Doing a $dir = `cd`; returns the directory the script was called from. Any ideas?open (INI, ">".$scriptPath."\\config.ini"); print INI "data:user_input"; close INI
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Script Directory vs. Directory Script was Called From
by maverick (Curate) on Aug 15, 2001 at 01:10 UTC | |
by seigniory (Sexton) on Aug 15, 2001 at 01:14 UTC | |
|
Re: Script Directory vs. Directory Script was Called From
by John M. Dlugosz (Monsignor) on Aug 15, 2001 at 01:40 UTC | |
|
Re: Script Directory vs. Directory Script was Called From
by tachyon (Chancellor) on Aug 15, 2001 at 03:57 UTC | |
|
Re: Script Directory vs. Directory Script was Called From
by runrig (Abbot) on Aug 15, 2001 at 04:09 UTC | |
|
Re: Script Directory vs. Directory Script was Called From
by foogod (Friar) on Aug 15, 2001 at 01:03 UTC | |
by foogod (Friar) on Aug 15, 2001 at 01:20 UTC | |
|
Re: Script Directory vs. Directory Script was Called From
by abstracts (Hermit) on Aug 15, 2001 at 00:52 UTC |