http://www.perlmonks.org?node_id=1054321


in reply to exports -- which module exports are used?

This is very useful. I ran it on a bunch of my scripts, and the results look great.

One of my scripts uses XML::Tidy, and gave me an unexpected result:

# use XML::Tidy(); # Not used?

So, I did some more poking at it:

$ perl -MXML::Tidy -le 'print $XML::Tidy::VERSION' 1.12.B55J2qn $ exports XML::Tidy Invalid version format (non-numeric data) at exports line ...

It points to the my $version = $mod->VERSION(); line. I'm not sure if there is anything that can be done about modules that use icky versions.

Replies are listed 'Best First'.
Re^2: exports -- which module exports are used? (XML::Tidy)
by tye (Sage) on Sep 16, 2013 at 18:39 UTC

    I assumed $mod->VERSION() was well behaved and hoped it would handle some weird new practices that don't appear to set $Module::Name::VERSION. But it not coping doesn't really surprise me. I'll use it and detect failure and fall back to just copying the $VERSION global.

    Though I don't see how this problem could be to blame for your "Not used?" result. As I mentioned above, that line only means "No exports used". If your code doesn't mention any of the *_NODE constants(?) that XML::Tidy exports, then that is the expected / desired result (and the recommended empty parens in "use XML::Tidy();" are recommended to document that no exports are being used).

    - tye        

      I just use the canned bin/xmltidy script that comes packaged with the module, and it does not use any of those constants. Thanks for the clarification.