From: Robin Houston Date: Wed, 17 Apr 2002 15:45:32 +0000 (+0100) Subject: "foo bar"->() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a6aa900aaa729fd6735df2eb96e87e52d2662e8;p=p5sagit%2Fp5-mst-13.2.git "foo bar"->() Message-ID: <20020417154532.A25446@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@15974 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index b10c1fb..786c7a4 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -2951,6 +2951,14 @@ sub pp_entersub { # it back. $kid =~ s/^CORE::GLOBAL:://; + # If the sub name is not a valid identifier, then somebody + # (probably Abigail) must have written "foo"->(...). Reproduce + # this. + if ($kid !~ /^([a-zA-Z_]|::)([a-zA-Z_0-9]|::)*$/) { + $kid = single_delim("qq", '"', uninterp(escape_str(unback($kid)))); + $kid .= "->"; + } + if (!$declared) { return "$kid(" . $args . ")"; } elsif (defined $proto and $proto eq "") {