Skip Menu |

This queue is for tickets about the local-lib CPAN distribution.

Report information
The Basics
Id: 99108
Status: rejected
Priority: 0/
Queue: local-lib

People
Owner: Nobody in particular
Requestors: bitcard [...] daedalus.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.000004
Fixed in: 2.000_005



Subject: "Use of uninitialized value" warning under Windows
When running perl -Mlocal::lib under Windows, the module behaves correctly (i.e. determines the user's home directory correctly), but a "Use of uninitialized value $user in concatenation or string" warning is thrown. This is caused by $user being undefined in resolve_home_path(), in the line: File::Glob::bsd_glob("~$user", File::Glob::GLOB_TILDE()); Replacing this with: File::Glob::bsd_glob("~".($user||""), File::Glob::GLOB_TILDE()); ...fixes the warning. Perl: Strawberry Perl 5.18.2 OS: Windows 7 SP1
On Wed Sep 24 06:57:55 2014, bitcard@daedalus.co.uk wrote: Show quoted text
> When running perl -Mlocal::lib under Windows, the module behaves > correctly (i.e. determines the user's home directory correctly), but a > "Use of uninitialized value $user in concatenation or string" warning > is thrown. This is caused by $user being undefined in > resolve_home_path(), in the line: > File::Glob::bsd_glob("~$user", File::Glob::GLOB_TILDE()); > > Replacing this with: > File::Glob::bsd_glob("~".($user||""), File::Glob::GLOB_TILDE()); > > ...fixes the warning. > > Perl: Strawberry Perl 5.18.2 > OS: Windows 7 SP1
I can't reproduce this, and based on the code I can't see how it would happen. Based on: $path =~ /^~([^\/]*)/ or return $path; my $user = $1; If the regex to find the user doesn't match, it will return immediately. If it does match, $user will end up with either a username or an empty string, not undef.
From: bitcard [...] daedalus.co.uk
My apologies - I had run direct checks against v2.000004, and checked that the File::Glob::bsd_glob line still existed in the latest version of local::lib, but didn't check the $path matching line. The issue was actually fixed in v 2.000_005.
Thanks for checking.