Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to implement IPC with scalars?

Reply
Thread Tools

How to implement IPC with scalars?

 
 
Eric
Guest
Posts: n/a
 
      09-14-2007
Hey newsgroup,

first of all, sorry for double-posting but I guess the subject of my
last post was perhaps not hitting the spot or so... It can be found
here: http://groups.google.de/group/comp.l...ab354f1af7b6e7

The main problem is that while pump()ing a child's output into my $out
scalar, new output is not fed sequentially, so I always get back the
entire output the program gave since it started.
Any ideas? Please, I really need this stuff. I can't find any examples
on the net apart from those in perlicp, which aren't explained in
great detail..

Thanks,
Eric

 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      09-14-2007

Quoth Eric <>:
> Hey newsgroup,
>
> first of all, sorry for double-posting but I guess the subject of my
> last post was perhaps not hitting the spot or so... It can be found
> here:

<deleted long URL>

Please don't do this: either continue the thread, or start a new thread
explaining from the beginning what you are talking about.

> The main problem is that while pump()ing a child's output into my $out
> scalar, new output is not fed sequentially, so I always get back the
> entire output the program gave since it started.


Read the docs for IPC::Run, in particular the example in the section
"Using regexps to match output".

Ben

 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      09-14-2007
Eric <> wrote:
> Hey newsgroup,
>
> first of all, sorry for double-posting but I guess the subject of my
> last post was perhaps not hitting the spot or so... It can be found
> here:
> http://groups.google.de/group/comp.l...thread/thread/
> 4f c35c6fa1a8f488/37ab354f1af7b6e7?hl=de#37ab354f1af7b6e7


You said that pipes didn't work, but you didn't say what the problem
was. You posted code that doesn't run under use strict. And you framed
the whole thing in the context of some other program that I (and
presumably many other people) have never heard of and have little interest
in, rather than in terms of Perl IPC.

>
> The main problem is that while pump()ing a child's output into my $out
> scalar, new output is not fed sequentially, so I always get back the
> entire output the program gave since it started.


Yes, that is what IPC::Run does when it is used in this way. However, it
doesn't seem to care if you screw around with the scalars in the mean time,
so you could try clearing it before calling pump again:
$out='';
(This doesn't seem to be documented in IPC::Run, but I haven't studied that
whole morass carefully.)

But you if you using regex, you probably can't do this exactly, as a
message that spans the buffer would never get found, you have have to clear
only up to the full match, leaving the incomplete nascent message there.

> Any ideas? Please, I really need this stuff. I can't find any examples
> on the net apart from those in perlicp, which aren't explained in
> great detail..


We are not likely to re-write an entire perldoc section based on such
vague complaints. If you have specific questions, please ask. Perhaps
we can explain them to you, as well as improve the docs.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
File Sharing IPC$ Problem =?Utf-8?B?SmltIE1jQ29sbA==?= Wireless Networking 7 10-25-2004 09:31 PM
IPC Mechanism Named pipes or Windows messages or sthg else ? piyush ASP .Net 0 07-14-2004 02:41 PM
IPC::Run and hanging pipes Brian Hann Perl 1 12-11-2003 08:41 PM
open, ipc, and return codes gary Perl 3 09-18-2003 12:17 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57