[tpm] sys call length limitation
Tom Legrady
legrady at gmail.com
Wed Jan 22 08:05:30 PST 2014
If you're sure the problem is in the s///, replace it with index() and
substr().
On Wed, Jan 22, 2014 at 10:25 AM, Antonio Sun <tpm.ats at spamgourmet.com>wrote:
>
> On Wed, Jan 22, 2014 at 12:54 AM, Shlomi Fish wrote:
>
> > > No luck, the matched string is actually one big base64 encoded string
>> > > in only one line.
>> >
>> > So send it in one megabyte chunks.
>>
>
> My one line file is only 238566 bytes in size. See OP for details.
>
> Yes, and one can use IPC::Run for that as I noted -
>> https://metacpan.org/release/IPC-Run - just open a process to accept its
>> STDIN
>> and pipe it to it, and then get its STDOUT.
>>
>
> For a process to accept STDIN and can get its STDOUT, the answer
> is IPC::Open2, because it is in the standard distribution and IPC::Run is
> not (Just learnt it myself when investigating the solution). Anyway, here
> is my IPC::Open2 version:
>
> perl -MFileHandle -MIPC::Open2 -n000e 'BEGIN { sub process { $pid =
> open2(*Reader, *Writer, "cat | wc -c"); print Writer $_[0]; waitpid( $pid,
> 0 ); $got = <Reader>; }; }; s,(?<=">)(.*?)(?=</HttpBody>),process $1,eg;
> print'
>
> And it just stops there forever, with or without the waitpid.
>
> The problem is the big s///g loop. Standalone IPC::Open2 read/write tested
> fine.
>
> Thanks for the input.
>
>
> _______________________________________________
> 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/20140122/bf20459c/attachment-0001.html>
More information about the toronto-pm
mailing list