diff options
author | John Peacock <jpeacock@rowman.com> | 2006-06-08 17:14:04 -0400 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-06-09 16:03:03 +0000 |
commit | 92dcf8ce268fff64097044a269995ffa27692a3d (patch) | |
tree | 7366c02363dc12211bd8168cf4f6a60680d4b1a1 /lib/version.pod | |
parent | 7e265ef3a760ea72c6406128afc4b4771e71c25e (diff) | |
download | perl-92dcf8ce268fff64097044a269995ffa27692a3d.tar.gz |
[patch] Fwd: CPAN Upload: J/JP/JPEACOCK/version-0.64.tar.gz
Message-ID: <4488CB5C.4070702@rowman.com>
p4raw-id: //depot/perl@28375
Diffstat (limited to 'lib/version.pod')
-rw-r--r-- | lib/version.pod | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/version.pod b/lib/version.pod index a8742033fe..0f4f20d45e 100644 --- a/lib/version.pod +++ b/lib/version.pod @@ -261,6 +261,19 @@ must be quoted to be converted properly. For this reason, it is strongly recommended that all initializers to qv() be quoted strings instead of bare numbers. +To prevent the C<qv()> function from being exported to the caller's namespace, +either use version with a null parameter: + + use version (); + +or just require version, like this: + + require version; + +Both methods will prevent the import() method from firing and exporting the +C<qv()> sub. This is true of subclasses of version as well, see +L<SUBCLASSING> for details. + =back For the subsequent examples, the following three objects will be used: @@ -570,14 +583,10 @@ derived class: See also L<version::AlphaBeta> on CPAN for an alternate representation of version strings. -B<NOTE:> the L<qv> operator is not a class method and will not be inherited -in the same way as the other methods. L<qv> will always return an object of -type L<version> and not an object in the derived class. If you need to -have L<qv> return an object in your derived class, add something like this: - - *::qv = sub { return bless version::qv(shift), __PACKAGE__ }; - -as seen in the test file F<t/02derived.t>. +B<NOTE:> Although the L<qv> operator is not a true class method, but rather a +function exported into the caller's namespace, a subclass of version will +inherit an import() function which will perform the correct magic on behalf +of the subclass. =head1 EXPORT |