From: Stephen McCamant Date: Tue, 7 Mar 2006 20:00:30 +0000 (-0800) Subject: Re: [perl #38684] O::Deparse not working as expected X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f86ea535d32a65363bd92042b52c18214b181403;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #38684] O::Deparse not working as expected Message-ID: <17422.22238.570532.2771@apocalypse.OCF.Berkeley.EDU> p4raw-id: //depot/perl@27415 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index bc7e16d..edd7512 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -4121,12 +4121,10 @@ sub pp_split { push @exprs, $self->deparse($kid, 6); } - # handle special case of split(), and split(" ") that compiles to /\s+/ + # handle special case of split(), and split(' ') that compiles to /\s+/ $kid = $op->first; - if ($kid->flags & OPf_SPECIAL - && $exprs[0] eq '/\\s+/' - && $kid->pmflags & PMf_SKIPWHITE ) { - $exprs[0] = '" "'; + if ($kid->flags & OPf_SPECIAL and $kid->pmflags & PMf_SKIPWHITE) { + $exprs[0] = "' '"; } $expr = "split(" . join(", ", @exprs) . ")"; diff --git a/ext/B/t/deparse.t b/ext/B/t/deparse.t index 8d8a1db..c1fa6c2 100644 --- a/ext/B/t/deparse.t +++ b/ext/B/t/deparse.t @@ -24,7 +24,7 @@ use warnings; use strict; use Config; -print "1..39\n"; +print "1..40\n"; use B::Deparse; my $deparse = B::Deparse->new() or print "not "; @@ -117,7 +117,7 @@ BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } LINE: while (defined($_ = )) { chomp $_; - our(@F) = split(" ", $_, 0); + our(@F) = split(' ', $_, 0); '???'; } EOF @@ -320,3 +320,7 @@ print $_ foreach (reverse @a); # 33 our @a; print $_ foreach (reverse 1, 2..5); +#### +# 34 (bug #38684) +our @ary; +@ary = split(' ', 'foo', 0);