This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
handy.h: Refactor macros to avoid aTHX_ problems
[perl5.git] / mad / Nomad.pm
old mode 100755 (executable)
new mode 100644 (file)
index 4fdd3a8..eaac474
@@ -674,7 +674,7 @@ sub ast {
        return P5AST::listop->new(Kids => [@before,@retval]);
     }
 
-    push @retval, $self->madness('o ( [ {');
+    push @retval, $self->madness('o ( [ {');
 
     my @newkids;
     for my $kid (@{$$self{Kids}}) {
@@ -1683,7 +1683,10 @@ sub ast {
     if ($rfirst[-1]->uni ne $llast[-1]->uni) {
        push @newkids, @rfirst;
     }
-
+    # remove the fake '\n' if /e and '#' in replacement.
+    if (@mods and $mods[0] =~ m/e/ and ($self->madness('R'))[0]->uni =~ m/#/) {
+        unshift @rlast, bless {}, 'chomp'; # hack to remove '\n'
+    }
     push @newkids, $bits->{repl}, @rlast, @mods;
 
     my $retval = $self->newtype->new(Kids => [@newkids]);
@@ -2835,6 +2838,7 @@ package PLXML::op_enterwrite;
 package PLXML::op_leavewrite;
 package PLXML::op_prtf;
 package PLXML::op_print;
+package PLXML::op_say;
 package PLXML::op_sysopen;
 package PLXML::op_sysseek;
 package PLXML::op_sysread;