fixed version handling to always give a string
Robert 'phaylon' Sedlacek [Fri, 11 May 2012 19:02:35 +0000 (19:02 +0000)]
lib/System/Introspector/LibDirs/Perl.pm

index 5bc01c4..2d71d0b 100644 (file)
@@ -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,
         };