How to get Perl version number DateTime :: Format :: DateManip from command line?

I use this from the command line:

perl -MDateTime::Format::DateManip -le 'print $Some::Module::VERSION'

but only returns an empty string, any thoughts?

+3
source share
2 answers

This is pseudo code, Somenot set, so it just prints undefwith a flag -l, for example perl -le'print undef;

Confirm alerts with -w

$ perl -MDateTime::Format::DateManip -wle 'print $Some::Module::VERSION'
Use of uninitialized value $Some::Module::VERSION in print at -e line 1.

Replace with the Some::Modulemodule you want to use.

Also, just for fun;)

Perl Shortcuts for Testing Version Numbers

, use <module> <version> perl , .

perl script use DateTime 9999;

$ perl -MDateTime\ 9999
DateTime version 9999 required--this is only version 0.51.
BEGIN failed--compilation aborted.

-, bash, . windows cmd,

$ perl -M"DateTime 9999"
DateTime version 9999 required--this is only version 0.51.
BEGIN failed--compilation aborted.

, cmd perl, .

+4

, pmvers CPAN. script :

pmvers DateTime::Format::DateManip
+2

Source: https://habr.com/ru/post/1729946/


All Articles