Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • It all depends on the &import of a module.

    Lingua::Identify [cpan.org] uses Exporter [cpan.org] which considers the parameter a version number and croaks because it's higher than the module's.

    strict [cpan.org] uses a custom importer which considers the number a non-existant pragma tag and croaks.

    In case noone else defines an &import, modules inherit &UNIVERSAL::import. Interestingly, that one does differentiate between a literal number and an expression:

    $ echo 'package Foo; our $VERSION = 0.1; 1;' > Foo.pm
    $ perl -le'BEGIN { $a = 1 } use Foo $a'
    $ perl -le'use Foo print'

    $ perl -le'use Foo 1'
    Foo version 1 required--this is only version 0.1 at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.