GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Module::Extract::VERSION(3) User Contributed Perl Documentation Module::Extract::VERSION(3)

Module::Extract::VERSION - Extract a module version safely

        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 );

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->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 $VERSION statement, 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:

        sigil
        fully-qualified variable name
        version value
        file name
        line number of $VERSION
    

This code is in Github:

        https://github.com/briandfoy/module-extract-version.git

brian d foy, "<briandfoy@pobox.com>"

I stole the some of this code from "mldistwatch" in the PAUSE code by Andreas König, but I've moved most of it around.

Andrey Starodubtsev added code to handle the v5.12 and v5.14 "package" syntax.

Copyright © 2008-2025, brian d foy "<briandfoy@pobox.com>". All rights reserved.

You may redistribute this under the Artistic License 2.0.

2025-04-14 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.