Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Checking $VERSION for ExtUtils::MakeMaker

by bsb (Priest)
on Dec 02, 2005 at 12:28 UTC ( [id://513575]=CUFP: print w/replies, xml ) Need Help??

VERSION_FROM in ExtUtils::MakeMaker scans a file for the first line matching:

/([\$*])(([\w\:\']*)\bVERSION)\b.*\=/
Then evals it, using the result as the version.

This snippet does it from the command line to check that everything works as you expect.

perl -nle 'if(/([\$*])(([\w\:'\'']*)\bVERSION)\b.*\=/){ eval $_; print + "$ARGV:\n$@$_\n\$$2 = $$2\n";close ARGV; undef $VERSION}' a b c d
Sample output:
a: (our $VERSION = '3.0') $VERSION = 3.0 b: my $VERSION = 2.0; $VERSION = c: Undefined subroutine &main::qv called at (eval 3) line 1, <> line 2. our $VERSION = qv(1.0); $VERSION = d: use version; our $VERSION = qv(1.0); $VERSION = v1.0.0

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://513575]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-24 03:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found