Subject: | dies because of an unhandled undefined value when run against empty files |
When Test::MinimumVersion is run against an empty file (such as /dev/
null, or an empty .pm file it found when using the all_ function) it
dies because of an unhandled undefined value returned by
Perl::MinimumVersion on line 76 of Test::MinimumVersion.
The simplest solution I could think of would be:
sub minimum_version_ok {
my ($file, $version) = @_;
if (-s $file) {
$Test->ok(1, $file);
return;
}
[...]
But of course, making the code gracefully handle undefs would be
better :)
Subject: | bug.pl |
use Test::MinimumVersion;
minimum_version_ok('/dev/null', '5.008');