in reply to eliminating warnings with conditional uses
The problem is that Perl tries to interpolate the variable VERSION in package prereq in line 115 of your code. As long as there is no prereq package, $v will be empty; you'll get another warning on line 117, because your eval in line 116 also returns an empty string.my @prereq = qw(DBI DBIx::AnyDBD); for my $prereq (@prereq) { eval "use $prereq" ; die "\nPlease install $prereq before installing DBSchema::Sample" +if ($@) ; my $v = "\$${prereq}::VERSION"; # LINE 115 my $v2 = eval $v; print "Found $prereq version $v2\n" ; # LINE 117 }
|
|---|