This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Adding Module::Build::Version missed in upgrade.
authorSteve Peters <steve@fisharerojo.org>
Sat, 15 Jul 2006 18:57:39 +0000 (18:57 +0000)
committerSteve Peters <steve@fisharerojo.org>
Sat, 15 Jul 2006 18:57:39 +0000 (18:57 +0000)
p4raw-id: //depot/perl@28581

MANIFEST
lib/Module/Build/Version.pm [new file with mode: 0644]

index 1e6a115..7875748 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -2039,6 +2039,7 @@ lib/Module/Build/t/signature.t    Module::Build
 lib/Module/Build/t/tilde.t     Module::Build
 lib/Module/Build/t/versions.t  Module::Build
 lib/Module/Build/t/xs.t                Module::Build
+lib/Module/Build/Version.pm    Module::Build
 lib/Module/Build/YAML.pm       Module::Build
 lib/Module/CoreList/bin/corelist       Module::CoreList
 lib/Module/CoreList.pm                 Module::CoreList
diff --git a/lib/Module/Build/Version.pm b/lib/Module/Build/Version.pm
new file mode 100644 (file)
index 0000000..f814746
--- /dev/null
@@ -0,0 +1,26 @@
+package Module::Build::Version;
+use base qw/version/;
+
+use overload (
+    '""' => \&stringify,
+);
+
+sub new {
+    my ($class, $value) = @_;
+    my $self = $class->SUPER::new($value);
+    $self->original($value);
+    return $self;
+}
+
+sub original {
+    my $self = shift;
+    $self->{original} = shift if @_;
+    return $self->{original};
+}
+
+sub stringify {
+    my $self = shift;
+    return $self->original;
+}
+
+1;