readpipe was always being deparse as `...` or qx.
This commit changes it to use the already-existing pure_string routine
to determine whether it can fit in `` first.
# skip pushmark if it exists (readpipe() vs ``)
my $child = $op->first->sibling->isa('B::NULL')
? $op->first : $op->first->sibling;
- return single_delim("qx", '`', $self->dq($child));
+ if ($self->pure_string($child)) {
+ return single_delim("qx", '`', $self->dq($child, 1));
+ }
+ unop($self, @_, "readpipe");
}
sub dquote {
each $@;
keys $~;
values $!;
+####
+# readpipe with complex expression
+readpipe $a + $b;