Skip to content
loading...

What's the version of that installed Perl module?

twitter logo ・1 min read  

Here's a neat trick to find out what version of a Perl module is installed.

Let's try with Carp.

perl -MCarp\ 99999 -e 1

Carp version 99999 required--this is only version 1.42.
BEGIN failed--compilation aborted.

The way this works is that we ask the runtime to load a very high version, and then wait for perl to apologize that it only has current version x, in this case 1.42.

Note the escaped space between the module and the version:
-MCarp\ 99999.

twitter logo DISCUSS (1)
markdown guide
 

The cpan command that comes with Perl can do this with the -D switch to get module details, including the latest CPAN version and local version.

Classic DEV Post from Mar 28

Programming Resources for Kids

For those of you with children at home during these “interesting” times that are teaching programming...

Johan Lindstrom profile image

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️