Change 13842 by jhi@alpha on 2001/12/21 22:32:14

        Subject: [PATCH B::Deparse] __DATA__ and packages
        From: Rafael Garcia-Suarez <[EMAIL PROTECTED]> 
        Date: Sat, 22 Dec 2001 00:01:29 +0100
        Message-ID: <20011222000129.A713@rafael>

Affected files ...

.... //depot/perl/ext/B/B/Deparse.pm#99 edit

Differences ...

==== //depot/perl/ext/B/B/Deparse.pm#99 (text) ====
Index: perl/ext/B/B/Deparse.pm
--- perl/ext/B/B/Deparse.pm.~1~ Fri Dec 21 15:45:06 2001
+++ perl/ext/B/B/Deparse.pm     Fri Dec 21 15:45:06 2001
@@ -561,9 +561,11 @@
 
        # 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"});
        }
     }
 }
End of Patch.

Reply via email to