From: Rafael Garcia-Suarez Date: Sat, 22 Dec 2001 00:01:29 +0000 (+0100) Subject: __DATA__ and packages X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96c57f7e641f15cc924272c2d866750e62c1b955;p=p5sagit%2Fp5-mst-13.2.git __DATA__ and packages Message-ID: <20011222000129.A713@rafael> p4raw-id: //depot/perl@13842 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 7bf95df..778cec7 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -561,9 +561,11 @@ sub compile { # Print __DATA__ section, if necessary no strict 'refs'; - if (defined *{$self->{'curstash'}."::DATA"}{IO}) { + my $laststash = defined $self->{'curcop'} + ? $self->{'curcop'}->stash->NAME : $self->{'curstash'}; + if (defined *{$laststash."::DATA"}{IO}) { print "__DATA__\n"; - print readline(*{$self->{'curstash'}."::DATA"}); + print readline(*{$laststash."::DATA"}); } } }