3 ms·
Interesting. I would have done it this way previously: perl -MData::Dumper -e 'print $Data::Dumper::VERSION."\n"'
by mike-cardwell 15y ago
Interesting. 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>