I’m using this from the command line:
perl -MDateTime::Format::DateManip -le 'print $Some::Module::VERSION'
but only return a blank line, any thoughts?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is pseudo-code,
Someisn’t set so it is just printing outundefwith the-lflag, likeperl -le'print undef;For evidence turn on warnings with
-wSubstitute
Some::Modulewith the module you want the version of.Also, just for fun 😉
Perl Shorthands for testing version numbers
These are quick ways to get version numbers by utilizing the
use <module> <version>syntax and perl’s vocal rejection of versions that aren’t new enough.These are all equivalent of creating a perl script with
use DateTime 9999;However, this fashion isn’t cross-platform, because you’re simply telling bash to escape a space. This doesn’t work in windows
cmd, for that you’ll have toHere, you just put it in quotes – that tells cmd to send it all as an argument to perl and it gets the same job done.