At 08:47 AM 8/14/01 -0700, I wrote:
>At 08:17 AM 8/14/01 -0700, John Sands wrote:
>>Using the -w flag and:
>> use Net::FTP
>>or
>> use Net::POP3
>>
>>gives this warning message:
>> Use of uninitialized value in concatenation (.) at
>>C:/Perl/site/lib/Net/Config.pm line 44.
>>
>>I know it's trivial, but I'd like to get rid of it. Does anyone know how
>>I can?
>>I'm using Perl 5.006 from ActiveState.
>
>Looks like you've found an enhancement opportunity; well-behaved modules
>ought to be -w clean on all platforms. The code triggering that warning is
>
> 43 my $home = eval { (getpwuid($>))[7] } || $ENV{HOME};
> 44 $file = $home . "/.libnetrc";
>
>and obviously on your Windows system getpwuid() is not implemented and
>neither is an environment variable HOME set.
>
>I will suggest a patch like this, which you could put in Config.pm yourself:
>
> 43 my $home = eval { (getpwuid($>))[7] } || $ENV{HOME} || '.';
> 44 $file = $home . "/.libnetrc";
Oops, spoke too soon. In the next version of Perl this has already been
fixed. Not in the currently stable one, but in the development
version. The new code looks like:
use File::Spec;
my $home = eval { (getpwuid($>))[7] } || $ENV{HOME} || $ENV{HOMEDRIVE}
|| $ENV{HOMEPATH} || File::Spec->curdir;
$file = File::Spec->catfile($home, ".libnetrc");
But DON'T PUT THAT IN. There are many many other changes to that file and
this probably won't work just by itself.
The patch I gave above will silence the warning for you right now. When
perl 5.8 is released, ActiveState will have a new version that will also work.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]