From: Rafael Garcia-Suarez Date: Sun, 18 Jan 2009 22:03:27 +0000 (+0100) Subject: [perl #62488] B::Deparse fails on 'CORE::require(STRING)' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=deb20ba30561f9f787c79f9c746b4043eef6822b;p=p5sagit%2Fp5-mst-13.2.git [perl #62488] B::Deparse fails on 'CORE::require(STRING)' This patch allows the following to deparse properly: perl -MO=Deparse -e 'CORE::require "CGI.pm"' (necessary due to the specific way require() is overriden) --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 753192d..c398ddb 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -1603,8 +1603,10 @@ sub unop { my $kid; if ($op->flags & OPf_KIDS) { $kid = $op->first; - if (defined prototype("CORE::$name") - && prototype("CORE::$name") =~ /^;?\*/ + my $builtinname = $name; + $builtinname =~ /^CORE::/ or $builtinname = "CORE::$name"; + if (defined prototype($builtinname) + && prototype($builtinname) =~ /^;?\*/ && $kid->name eq "rv2gv") { $kid = $kid->first; }