For a temporary file, you'd want to use the File::Temp module (see http://search.cpan.org/~tjenness/File-Temp-0.16/Temp.pm ).

For a permanent file, such as a configuration file, you'd probably have to figure it out for each operating system, and then test $^O to figure out which operating system you're running under. Each OS is different in where different kinds of files should be stored.

On Jul 13, 2006, at 12:40 PM, Nishi Bhonsle wrote:

Hi:

If I have to create a writeable file say write.txt on fly during program execution under the OS default/local drive of a machine ie C:\ or D: \ on windows and /home/user etc on unix, how can I get that local/ default drive using perl so that I dont have to hardcode C:\ or D:\ or /home etc inside
the script as path to the write.txt.

Thanks much.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to