Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Wednesday May 20, 2009
03:51 AM

Module Version Vim Binding

[ #39007 ]

Like most Perl programmers I know, I have a tiny command line utility which prints out a module version:

#!/usr/bin/env perl
my $module = shift;

package OVID::PVERSION; # for modules which won't let you use 'em in %main::
eval "use $module";
die $@ if $@;
print $module->VERSION || "Could not determine a version for $module", $/;

__END__

=head1 NAME

pversion

=head1 SYNOPSIS

pversion Some::Module

=head1 DESCRIPTION

Prints out the Perl version number of an installed module.

=cut

Today, while trying to figure out a versioning issue in vim, I added the ,pv mapping. If you're on a module name and type that, it automatically displays the version number.

noremap  ,pv  :!echo <cword> version `$HOME/bin/pversion '<cword>'`<cr>

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.