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
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?
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [
Carl Sajjan wrote:
From: Rob Dixon
Carl Sajjan wrote:
I am chaged with setting up LDAP monitoring using some tool. I came across
this Look.pl utility. But when I try to run this file I got the error...
I am a newbie to PERL.
perl look.pl
/usr/perl5/5.6.1/lib//sun4-solaris-64int
/usr/perl5/5