formats can't contain formats
authorRobin Houston <robin@cpan.org>
Sat, 14 Jul 2001 14:28:50 +0000 (15:28 +0100)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Mon, 16 Jul 2001 13:35:39 +0000 (13:35 +0000)
Message-Id:  <20010714142850.A10205@robin>

p4raw-id: //depot/perl@11379

ext/B/B/Deparse.pm

index 08f073e..4c8dc74 100644 (file)
@@ -768,8 +768,9 @@ sub deparse_format {
     my @text;
     local($self->{'curcv'}) = $form;
     local($self->{'curcvlex'});
+    local($self->{'in_format'}) = 1;
     local(@$self{qw'curstash warnings hints'})
-               = @$self{'curstash warnings hints'};
+               = @$self{qw'curstash warnings hints'};
     my $op = $form->ROOT;
     my $kid;
     $op = $op->first->first; # skip leavewrite, lineseq
@@ -1064,7 +1065,7 @@ sub lineseq {
     }
     my $body = join(";\n", grep {length} @exprs);
     my $subs = "";
-    if (defined $root && defined $limit_seq) {
+    if (defined $root && defined $limit_seq && !$self->{'in_format'}) {
        $subs = join "\n", $self->seq_subs($limit_seq);
     }
     return join(";\n", grep {length} $body, $subs);