.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "V 3pm" .TH V 3pm "2022-05-30" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" V \- Print version of the specified module(s). .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& $ perl \-MV=V .Ve .PP or if you want more than one .PP .Vb 1 \& $ perl \-MV=CPAN,V .Ve .PP Can now also be used as a light-weight module for getting versions of modules without loading them: .PP .Vb 2 \& require V; \& printf "%s has version \*(Aq%s\*(Aq\en", "V", V::get_version( "V" ); .Ve .PP If you want all available files/versions from \f(CW@INC\fR: .PP .Vb 5 \& require V; \& my @all_V = V::Module::Info\->all_installed("V"); \& printf "%s:\en", $all_V[0]\->name; \& printf "\et%\-50s \- %s\en", $_\->file, $_\->version \& for @all_V; .Ve .PP Each element in that array isa \f(CW\*(C`V::Module::Info\*(C'\fR object with 3 attributes and a method: .IP "\fIattribute\fR \fBname\fR" 4 .IX Item "attribute name" The package name. .IP "\fIattribute\fR \fBfile\fR" 4 .IX Item "attribute file" Full filename with directory. .IP "\fIattribute\fR \fBdir\fR" 4 .IX Item "attribute dir" The base directory (from \f(CW@INC\fR) where the package-file was found. .IP "\fImethod\fR \fBversion\fR" 4 .IX Item "method version" This method will look through the file to see if it can find a version assignment in the file and uses that determine the version. As of version 0.13_01, all versions found are passed through the version module. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module uses stolen code from Module::Info to find the location and version of the specified module(s). It prints them and \fBexit()\fRs. .PP It defines \f(CW\*(C`import()\*(C'\fR and is based on an idea from Michael Schwern on the perl5\-porters list. See the discussion: .PP .Vb 1 \& https://www.nntp.perl.org/group/perl.perl5.porters/2002/01/msg51007.html .Ve .SS "V::get_version($pkg)" .IX Subsection "V::get_version($pkg)" Returns the version of the first available file for this package as found by following \f(CW@INC\fR. .PP \fIArguments\fR .IX Subsection "Arguments" .ie n .IP "1. $pkg" 4 .el .IP "1. \f(CW$pkg\fR" 4 .IX Item "1. $pkg" The name of the package for which one wants to know the version. .PP \fIResponse\fR .IX Subsection "Response" .PP This \f(CW\*(C`V::get_version()\*(C'\fR returns the version of the file that was first found for this package by following \f(CW@INC\fR or \f(CW\*(C`undef\*(C'\fR if no file was found. .SH "AUTHOR" .IX Header "AUTHOR" Abe Timmerman \f(CW\*(C`\*(C'\fR. .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2002\-2006 Abe Timmerman, All Rights Reserved. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0