~/.bashrc Perl Module Version Tip

I often need to quickly check the version of a perl module currently installed. A while back I got tired of running:

[michael@orion(~/)] perl -MPOE::Filter -e 'print $POE::Filter::VERSION, "\n"'
1.2357

So I added a quick function to .bashrc:

pm-vers () {
    perl -M$1 -e "print \$$1::VERSION, \"\n\""
}

Now I just run:

[michael@orion(~/)] pm-vers POE::Filter
1.2357

Tags: , , ,

Leave a Reply