<div dir="ltr">Take a look at perldoc perlipc (search for Using open() for IPC)<div>Alternatively, use IO::All and something like this </div><div>perl -MIO::All -e'my $i = io(q{rev})->pipe; $i->print(qq{foo\nbar\n});'</div>
<div><div>oof</div><div>rab</div></div><div><br></div><div>Cheers,<br>Matt</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 21, 2014 at 12:29 PM, Antonio Sun <span dir="ltr"><<a href="mailto:tpm.ats@spamgourmet.com" target="_blank">tpm.ats@spamgourmet.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">Hi,</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">I have a script that works on xml content. A thousand time simplified version is:</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px"> xml_output | perl -n000e </span><span style="font-family:arial,sans-serif;font-size:13px">'s,(?<=">)(.*?)(?=</</span><span style="font-family:arial,sans-serif;font-size:13px">HttpBody>),</span><font face="arial, sans-serif">`echo $1 | wc -c`,eg; print'</font><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><font face="arial, sans-serif">I.e., I need to pipe the matching string ($1, content between tag </font><span style="font-family:arial,sans-serif;font-size:13px">HttpBody) to an external program via shell. As you can tell, </span><span style="font-family:arial,sans-serif;font-size:13px">if the </span><span style="font-family:arial,sans-serif">matching </span><span style="font-family:arial,sans-serif;font-size:13px">content</span><span style="font-family:arial,sans-serif;font-size:13px"> is too big for shell parameter length, my script will fail.</span></div>
<div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">I *have to* process the </span><span style="font-family:arial,sans-serif">matching string via the </span><span style="font-family:arial,sans-serif;font-size:13px">external program. Is there any way I can get around this? </span></div>
<div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">Thanks</span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra">
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">Antonio</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra">
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></font></span></div>
<br>_______________________________________________<br>
toronto-pm mailing list<br>
<a href="mailto:toronto-pm@pm.org">toronto-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/toronto-pm" target="_blank">http://mail.pm.org/mailman/listinfo/toronto-pm</a><br>
<br></blockquote></div><br></div>