[tpm] How to pipe variable content to shell scripts

Matthew Phillips mattp at cpan.org
Tue Jan 21 10:21:21 PST 2014


Take a look at perldoc perlipc (search for Using open() for IPC)
Alternatively, use IO::All and something like this
perl -MIO::All -e'my $i = io(q{rev})->pipe;  $i->print(qq{foo\nbar\n});'
oof
rab

Cheers,
Matt


On Tue, Jan 21, 2014 at 12:29 PM, Antonio Sun <tpm.ats at spamgourmet.com>wrote:

> Hi,
>
> I have a script that works on xml content. A thousand time simplified
> version is:
>
>  xml_output | perl -n000e 's,(?<=">)(.*?)(?=</HttpBody>),`echo $1 | wc
> -c`,eg; print'
>
> I.e., I need to pipe the matching string ($1, content between tag HttpBody)
> to an external program via shell. As you can tell, if the matching content is
> too big for shell parameter length, my script will fail.
>
> I *have to* process the matching string via the external program. Is
> there any way I can get around this?
>
> Thanks
>
> Antonio
>
>
>
>
>
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20140121/21a22474/attachment.html>


More information about the toronto-pm mailing list