On Mon, 2007-02-26 at 11:40 -0500, [EMAIL PROTECTED] wrote:
> Or depending on when you need this found. you might able to use.
>
> chomp($home=`pwd`);
This is so unlikely to work I would never do this. I start scripts in
my home directory < 10% of the time.
--
Ken Foskey
FOSS developer
--
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
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
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 S
Daniel Kasak wrote:
> Hi all.
Hello,
> 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?
$ perl -le'print( ( getpwuid $< )[ -2 ] )'
/home/john
$ perl -le'print $ENV{ HOME }'
/home/john
John
--
Perl isn't a toolbox, b
On 2/25/07, Daniel Kasak <[EMAIL PROTECTED]> wrote:
How do I, inside Perl, get the path of the home directory?
my $user_home_dir = $ENV{HOME} || (getpwuid($<))[7]; # maybe?
You could also try chdir with no arguments and see where it takes you.
I assume if I can do this, it will only work