Or depending on when you need this found. you might able to use. 
 
chomp($home=`pwd`); 
 
-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; beginners@perl.org
Sent: Mon, 26 Feb 2007 4:50 AM
Subject: Re: Home directory


Hi, 


On 2007/02/26, at 02:26, Thomas Yan wrote:


Hello,


Hi all.
How do I, inside Perl, get the path of the home directory?
I assume if I can do this, it will only work under Linux / Unix?


          Under windows you can use                 print $ENV{USERPROFILE}     
       to get the home directory.           such as: C:\Documents and 
Settings\yantao
          USERPROFILE is the environment variable.
          



You can also use the File::HomeDir module, that implements the abstraction for 
those operational systems.


HTH!


--
Igor Sutton Lopes <[EMAIL PROTECTED]>






= 
________________________________________________________________________
Check out the new AOL.  Most comprehensive set of free safety and security 
tools, free access to millions of high-quality videos from across the web, free 
AOL Mail and more.

Reply via email to