4 ms·
It's missing one of my favorites: perl -MData::Dumper\ 999 Quickest way to get the version of a module you're running.
by symkat 15y ago
It's missing one of my favorites:
perl -MData::Dumper\ 999
Quickest way to get the version of a module you're running.
- pkrumins 15y agoDoesn't work for File::Slurp, which has version 9999.19. :) Otherwise awesome thingy to query module versions.
- mike-cardwell 15y agoInteresting. I would have done it this way previously: perl -MData::Dumper -e 'print $Data::Dumper::VERSION."\n"'
- pkrumins 15y agoWorks for any module: $ perl -MLWP::UserAgent\ 999 LWP::UserAgent version 999 required--this is only version 5.833.
- mike-cardwell 15y agomike@server:~$ perl -MLWP::UserAgent -e 'print $LWP::UserAgent::VERSION."\n"' 5.835 mike@server:~$
- pkrumins 15y agoThat works, too!
- d5ve 15y agoEven shorter, as -l appends \n to all prints: $ perl -MLWP::UserAgent -le 'print $LWP::UserAgent::VERSION'
- pkrumins 15y agoEven shorter! $ M=LWP::UserAgent && perl -M$M -le "print \$$M::VERSION" Even even shorter! $ M=LWP::UserAgent;perl -M$M -Esay\$$M::VERSION
- sliverstorm 15y agoThis reminds me of that joke in which jokes have been reduced to numbers. It's nearly as obscure, too.
- pkrumins 15y agoDid Gödel come up with that joke?
- jrockway 15y agoWell, almost any module: $ perl -MFile::Slurp\ 9999 <hangs forever>
- ojosilva 15y agoI'm a fan of the "V" module. perl -MV=Data::Dumper "Quicker", if you don't count install time. cpanm -n V
- stouset 15y agoShit like this is why Perl gets under my skin. The best way to do anything in Perl always seems to be some side effect of a clever hack, instead of actually solving the damn problem expressively. The equivalent in Ruby? gem list $GEMNAME It's shorter and more clear. Take that, Perl golfers!