Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

perl - UNIVERSAL does not export anything

Tags:

perl

Hi I am getting the following error when trying to run a perl script:

pc:~/Phd/lenovo/programs/vep/scripts/variant_effect_predictor$ perl variant_effect_predictor.pl --help
UNIVERSAL does not export anything at /home/arron/Phd/lenovo/programs/vep/scripts/variant_effect_predictor/Bio/Tree/TreeFunctionsI.pm line 94.

where the offending line is:

use UNIVERSAL qw(isa)

what is the issue?

like image 434
brucezepplin Avatar asked Jun 30 '26 22:06

brucezepplin


2 Answers

Older versions of UNIVERSAL say

You may request the import of three functions (isa, can, and VERSION), but this feature is deprecated and will be removed. Please don't do this in new code.

The latest version just says

EXPORTS

None.

like image 144
choroba Avatar answered Jul 03 '26 14:07

choroba


From the documentation of Universal:

Previous versions of this documentation suggested using isa as a function to determine the type of a reference:

use UNIVERSAL 'isa';

$yes = isa $h, "HASH";
$yes = isa "Foo", "Bar";

The problem is that this code would never call an overridden isa method in any class. Instead, use reftype from Scalar::Util for the first case:

use Scalar::Util 'reftype';

$yes = reftype( $h ) eq "HASH";

So this method does not exist anymore.

like image 28
bolav Avatar answered Jul 03 '26 14:07

bolav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!