From: Rafael Garcia-Suarez Date: Sat, 17 May 2003 11:36:08 +0000 (+0000) Subject: Fix bug #22216 : B::Deparse can't handle "use Module Version" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a58644dec03db93f2899d4dd4466cc91cea2bd00;p=p5sagit%2Fp5-mst-13.2.git Fix bug #22216 : B::Deparse can't handle "use Module Version" with fractional version numbers or v-strings. p4raw-id: //depot/perl@19539 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 6a1fc72..06d795a 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -326,7 +326,14 @@ sub begin_is_use { return unless $self->const_sv($constop)->PV eq $module; $constop = $constop->sibling; - $version = $self->const_sv($constop)->int_value; + $version = $self->const_sv($constop); + if (class($version) ne "PVMG") { + # version is either an integer or a double + $version = $version->PV; + } else { + # version specified as a v-string + $version = 'v'.join '.', map ord, split //, $version->PV; + } $constop = $constop->sibling; return if $constop->name ne "method_named"; return if $self->const_sv($constop)->PV ne "VERSION";