NewsClipper
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
}
# --------------------------------------------------------------------------
# Figures out the user's home directory in Unix
sub Get_Home_Directory()
{
# Get the user's home directory. First try the password info, then the
# registry (if it's a Windows machine), then any HOME environment variable.
my $home = eval { (getpwuid($>))[7] } || $ENV{HOME};
die <<" EOF"
News Clipper could not determine your home directory. I tried to get your
home directory using both getpwuid and your HOME environment variable.
EOF
unless defined $home;
return $home;
}
# --------------------------------------------------------------------------
# Figures out the user's old installation directory, or returns undef
NewsClipper.pl view on Meta::CPAN
# ------------------------------------------------------------------------------
# Simply gets the home directory. First it tries to get it from the password
# file, then from the Windows registry, and finally from the HOME environment
# variable.
sub GetHomeDirectory()
{
# Get the user's home directory. First try the password info, then the
# registry (if it's a Windows machine), then any HOME environment variable.
my $home = $opts{H} || eval { (getpwuid($>))[7] } ||
GetWinInstallDir() || $ENV{HOME};
# "s cause problems in Windows. Sometimes people set their home variable as
# "c:\Program Files\NewsClipper", which causes when the path is therefore
# "c:\Program Files\NewsClipper"\.NewsClipper\Handler\Acquisition
$home =~ s/"//g if defined $home;
die <<" EOF"
News Clipper could not determine your home directory. On non-Windows
machines, News Clipper attempts to get your home directory using getpwuid,
then the HOME environment variable. On Windows machines, it attempts to
read the registry entry "HKEY_LOCAL_MACHINE\\SOFTWARE\\Spinnaker
Software\\News Clipper\\$VERSION" then tries the HOME environment
variable.
EOF
unless defined $home;
return $home;
}
( run in 0.349 second using v1.01-cache-2.11-cpan-454fe037f31 )