Re: [PATCH - DUH] Synchronize bleadperl with version-0.60
authorJohn Peacock <jpeacock@rowman.com>
Mon, 22 May 2006 19:08:03 +0000 (15:08 -0400)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 23 May 2006 07:23:48 +0000 (07:23 +0000)
Message-ID: <44724453.5090606@rowman.com>

p4raw-id: //depot/perl@28288

lib/version.pm
lib/version.t

index dcf5804..3fcb6b1 100644 (file)
@@ -6,7 +6,7 @@ use strict;
 
 use vars qw(@ISA $VERSION $CLASS *qv);
 
-$VERSION = "0.60_01";
+$VERSION = "0.60_02";
 $VERSION = eval($VERSION);
 
 $CLASS = 'version';
@@ -18,7 +18,9 @@ sub import {
     no strict 'refs';
     
     *{$callpkg."::qv"} = 
-           sub {return bless version::qv(shift), $class };
+           sub {return bless version::qv(shift), $class }
+       unless $callpkg->can('qv');
+
 }
 
 1;
index 05c0965..055531c 100644 (file)
@@ -57,6 +57,12 @@ eval { my $test = $testobj > 1.0 };
 like($@, qr/Invalid version object/,
     "Bad subclass vcmp");
 
+# dummy up a redundant call to satify David Wheeler
+local $SIG{__WARN__} = sub { die $_[0] };
+eval 'use version;';
+unlike ($@, qr/^Subroutine main::qv redefined/,
+    "Only export qv once per package (to prevent redefined warnings)."); 
+
 sub BaseTests {
 
        my ($CLASS, $no_qv) = @_;