Module::Extract::VERSION3pm
Extract a module version safely
Usage
use Module::Extract::VERSION;my $version # just the version= Module::Extract::VERSION->parse_version_safely( $file );my @version_info # extra info= Module::Extract::VERSION->parse_version_safely( $file );
Overview
This module lets you pull out of module source code the version number for the module. It assumes that there is only one $VERSION in the file and the entire $VERSION statement is on the same line.
Class methods
- $class->parse_version_safely( FILE );
-
Given a module file, return the module version. This works just like
"mldistwatch"in PAUSE. It looks for the single line that has the$VERSIONstatement, extracts it, evals it in a Safe compartment, and returns the result.In scalar context, it returns just the version as a string. In list context, it returns the list of:
sigilfully-qualified variable nameversion valuefile nameline number of $VERSION
Source availability
This code is in Github:
https://github.com/briandfoy/module-extract-version.git
Copyright and license
Copyright © 2008-2025, brian d foy "<[email protected]>". All rights reserved.
You may redistribute this under the Artistic License 2.0.
Releases
2 releases since Debian 12 (Bookworm); the text changed 1 time.