brian d foy

NAME

Module::Extract::DeclaredMinimumPerl - Extract the version of Perl a module declares

SYNOPSIS

        use Module::Extract::DeclaredMinimumPerl;

        my $extor = Module::Extract::DeclaredMinimumPerl->new;

        my $version = $extor->get_minimum_declared_perl( $file );
        if( $extor->error ) { ... }

DESCRIPTION

Extract the largest declared Perl version and returns it as a version object. For instance, in a script you might have:

  use v5.16;
  

This module will extract that v5.16 and return it.

This module tries to handle any format that PPI will recognize, passing them through version.pm to normalize them.

new

Makes an object. The object doesn't do anything just yet, but you need it to call the methods.

init

Set up the object. You shouldn't need to call this yourself. You can override it though!

get_minimum_declared_perl( FILE )

Extracts all of the declared minimum versions for Perl, sorts them, and returns the largest a version object.

error

Return the error from the last call to get_modules.

TO DO

  • Make it recursive, so it scans the source for any module that it finds.

SEE ALSO

Module::Extract::Use

SOURCE AVAILABILITY

The source code is in Github: git://github.com/briandfoy/Module-Extract-DeclaredMinimumPerl.git

AUTHOR

brian d foy, <bdfoy@cpan.org>

COPYRIGHT AND LICENSE

Copyright (c) 2011-2014, brian d foy, All Rights Reserved.

You may redistribute this under the same terms as Perl itself.




Hosting generously
sponsored by Bytemark