summaryrefslogtreecommitdiff
path: root/lib/version.pm
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@jpeacock-hp.doesntexist.org>2010-01-25 21:49:55 -0500
committerDavid Golden <dagolden@cpan.org>2010-02-06 15:10:11 -0500
commit61a0cb1c57a82d328c88c2dd525c91495edb2db9 (patch)
tree83be8a2ecf88a749916530a4ede50604733c6bdf /lib/version.pm
parentd0a76353c03de55a7ec9f5f128afee8d3c83e23f (diff)
downloadperl-61a0cb1c57a82d328c88c2dd525c91495edb2db9.tar.gz
Export and document is_lax and is_strict functions
Allow the is_lax and is_strict functions to be optionally exported to the caller's namespace (without having to use Exporter). Document the usage of is_lax and is_strict, plus nuke some trailing spaces.
Diffstat (limited to 'lib/version.pm')
-rw-r--r--lib/version.pm20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/version.pm b/lib/version.pm
index 424463d035..6b44e24cd5 100644
--- a/lib/version.pm
+++ b/lib/version.pm
@@ -141,19 +141,31 @@ sub import {
my $callpkg = caller();
if (exists($args{declare})) {
- *{$callpkg."::declare"} =
+ *{$callpkg.'::declare'} =
sub {return $class->declare(shift) }
unless defined(&{$callpkg.'::declare'});
}
if (exists($args{qv})) {
- *{$callpkg."::qv"} =
+ *{$callpkg.'::qv'} =
sub {return $class->qv(shift) }
- unless defined(&{"$callpkg\::qv"});
+ unless defined(&{$callpkg.'::qv'});
}
if (exists($args{'VERSION'})) {
- *{$callpkg."::VERSION"} = \&version::_VERSION;
+ *{$callpkg.'::VERSION'} = \&version::_VERSION;
+ }
+
+ if (exists($args{'is_strict'})) {
+ *{$callpkg.'::is_strict'} =
+ sub {return $class->is_strict(shift)}
+ unless defined(&{$callpkg.'::is_strict'});
+ }
+
+ if (exists($args{'is_lax'})) {
+ *{$callpkg.'::is_lax'} =
+ sub {return $class->is_lax(shift)}
+ unless defined(&{$callpkg.'::is_lax'});
}
}