[tpm] Pipe expression result through external filter command
Antonio Sun
antoniosun at lavabit.com
Mon May 14 10:29:47 PDT 2012
On Mon, May 14, 2012 at 12:06 PM, Antonio Sun <antoniosun at lavabit.com>wrote:
> I need to calculate 12+34, then pipe this expression result through an
> external shell filter command, say 'rev'.
>
> ultimately, I'm going to use the whole expression in the second part of
> string replace 's/.../.../eg' operation.
>
Maybe I have to do it in two steps:
perl -e '$str = "1234"; $str =~ s/1234/$var = $&; `echo $var | rev`/e;
print $str'
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20120514/84478810/attachment.html>
More information about the toronto-pm
mailing list