On 12/07/06, Smylers <[EMAIL PROTECTED]> wrote:
David Wheeler writes:> On Jul 12, 2006, at 03:41, Gabor Szabo wrote: > > >perl -MModule -e'print $Module::VERSION' > > I have this alias set up: > > function pv () { perl -M$1 -le "print $1->VERSION"; } Along similar lines, I have this one-liner as ~/bin/pmv: #! /bin/sh perl -m$1 -le 'print '$1'->VERSION || die "No VERSION in '$1'\n"' > I think that calling ->VERSION is more correct. So do I. In fact I used to use $VERSION in my script, but changed to ->VERSION after some situation in which it worked and $VERSION didn't. Sorry, I can't right now remember what that was.
These all fail for modules that do interesting things. For example Test::NoWarnings performs a Test::Builder test in an END block to make sure there were no warnings. I could change it so that it tries to figure out whether it's being used for real or not and disable the END block code but that's stress and hassle. As a module author, as far as I'm concerned, if MakeMaker can figure out my version then my job is done, F
