summaryrefslogtreecommitdiff
path: root/ext/B
diff options
context:
space:
mode:
Diffstat (limited to 'ext/B')
-rw-r--r--ext/B/B/Deparse.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index 06d795a2a4..b700650ec6 100644
--- a/ext/B/B/Deparse.pm
+++ b/ext/B/B/Deparse.pm
@@ -922,6 +922,10 @@ sub maybe_local {
if ($op->private & (OPpLVAL_INTRO|$our_intro)
and not $self->{'avoid_local'}{$$op}) {
my $our_local = ($op->private & OPpLVAL_INTRO) ? "local" : "our";
+ if( $our_local eq 'our' ) {
+ die "Unexpected our($text)\n" unless $text =~ /^\W(\w+::)*\w+\z/;
+ $text =~ s/(\w+::)+//;
+ }
if (want_scalar($op)) {
return "$our_local $text";
} else {