in reply to Re: CoreList stuff
in thread CoreList stuff

Funny, I've been having trouble getting the version number of the module in the above code. This works, but I have a feeling there's a better way:
use Carp; my $module = "CGI"; eval "require $module"; if ($@) { carp "Problem with require of $module: $@"; } else { { no strict "refs"; my $version = ${ $module. "::VERSION" }; print "We have $module installed, version: $version\n"; } }

Replies are listed 'Best First'.
Re^3: CoreList stuff
by Anonymous Monk on Feb 01, 2009 at 23:07 UTC
    warn UNIVERSAL::VERSION($module); warn $module->VERSION;