From: Robert 'phaylon' Sedlacek Date: Fri, 11 May 2012 19:02:35 +0000 (+0000) Subject: fixed version handling to always give a string X-Git-Tag: v0.001_001~72 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=474bd45471c8b8e6767225167eb9f5008273c867;p=scpubgit%2FSystem-Introspector.git fixed version handling to always give a string --- diff --git a/lib/System/Introspector/LibDirs/Perl.pm b/lib/System/Introspector/LibDirs/Perl.pm index 5bc01c4..2d71d0b 100644 --- a/lib/System/Introspector/LibDirs/Perl.pm +++ b/lib/System/Introspector/LibDirs/Perl.pm @@ -38,9 +38,14 @@ sub _gather_libdir_info { next unless $metadata->name; my $sha = Digest::SHA->new(256); $sha->addfile($line); + my $version = $metadata->version; push @{ $module{ $metadata->name } //= [] }, { file => $line, - version => $metadata->version, + version => ( + defined($version) + ? sprintf('%s', $version) + : undef + ), size => scalar(-s $line), sha256_hex => $sha->hexdigest, };