Re: SOLVED - Re: perl and pipes - reading from syslog-ng

2010-12-16 Thread Shlomi Fish
Hi Gary, On Wednesday 15 December 2010 14:42:56 Gary Stainburn wrote: > HI Shlomi, > > On Wednesday 15 December 2010 11:57:25 Shlomi Fish wrote: > [snip] > > > > while () { > > > > > > my $line=$_; > > > > Why are you doing this instead of: > > > > [code] > > while (my $line = ) > > { > >

Re: SOLVED - Re: perl and pipes - reading from syslog-ng

2010-12-15 Thread Gary Stainburn
HI Shlomi, On Wednesday 15 December 2010 11:57:25 Shlomi Fish wrote: [snip] > > > > while () { > > my $line=$_; > > Why are you doing this instead of: > > [code] > while (my $line = ) > { > } > [/code] > For two reason, (1) I've not written Perl in ages and forgotten much of the style and syn

Re: SOLVED - Re: perl and pipes - reading from syslog-ng

2010-12-15 Thread Shlomi Fish
Hi Gary, On Wednesday 15 December 2010 13:30:00 Gary Stainburn wrote: > Isn't it typical. Been working on this since yesterday, but as soon as I > post the question I find the answer· > > I've changed > > foreach my $line () { > > to > > while () { > my $line=$_; > Why are you doing this

SOLVED - Re: perl and pipes - reading from syslog-ng

2010-12-15 Thread Gary Stainburn
Isn't it typical. Been working on this since yesterday, but as soon as I post the question I find the answer· I've changed foreach my $line () { to while () { my $line=$_; and now it works perfectly. On Wednesday 15 December 2010 11:19:07 Gary Stainburn wrote: > Hi folks. > > I've writte

perl and pipes - reading from syslog-ng

2010-12-15 Thread Gary Stainburn
Hi folks. I've written a small perl script that reads from STDIN, parses the data and inserts into a database. It takes the output from syslog-ng and captures output from my firewall. I've configured syslog-ng to send output to the pipe and if I run cat /var/log/firewall/pipe I see the outpu

Re: Reading from multiple pipes

2009-09-30 Thread Ed Avis
Ed Avis waniasset.com> writes: >I'd like to fork several child processes and read lines from each It appears that IO::BufferedSelect does what I want! From its documentation: use IO::BufferedSelect; my $bs = new BufferedSelect($fh1, $fh2); while(1) { my @ready = $bs->re

Re: Reading from multiple pipes

2009-09-30 Thread Ed Avis
Ed Avis waniasset.com> writes: >I'd like to fork several child processes and read lines from each, There is IO::Select which provides a convenient way to see which filehandles have data for reading. But there is no guarantee that the data available will form a complete line. I am looking for s

Reading from multiple pipes

2009-09-30 Thread Ed Avis
I'd like to fork several child processes and read lines from each, for example: open my $fh_foo, '-|', 'yes', 'foo' or die $!; open my $fh_bar, '-|', 'yes', 'bar' or die $!; while (<$fh_foo> OR <$fh_bar>) { # magic happens here say "got a line from one of them: $_

Re: Unix pipes vs DOS pipes

2006-05-15 Thread Sumo Wrestler (or just ate too much)
Windows XP, it takes minutes! [...] AFAIK, unix pipes have some functionality that DOS pipes don't have. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Unix pipes vs DOS pipes

2006-05-15 Thread Mock, George
Hello! When I try this on Unix, it runs pretty fast ... spew_10MB_or_more | perl my_script.pl This finishes in seconds, even though the command spew_10MB_or_more creates very large text files that often exceed 10 MB. When I do the same thing on a DOS shell under Windows XP, it takes minutes

Re: get rid of whitespace around pipes??

2003-12-17 Thread Jeff 'japhy' Pinyan
On Dec 17, LoneWolf said: >I am parsing a massive file line by line and cleaning it up. It has about >15 fields, all separated by | and I want to remove the white space from >before and after the pipes so that as the information is parsed it gets rid >of external white spaces from th

Re: get rid of whitespace around pipes??

2003-12-17 Thread James Edward Gray II
On Dec 17, 2003, at 10:26 AM, LoneWolf wrote: I am parsing a massive file line by line and cleaning it up. It has about 15 fields, all separated by | and I want to remove the white space from before and after the pipes so that as the information is parsed it gets rid of external white spaces

Re: get rid of whitespace around pipes??

2003-12-17 Thread Randy W. Sims
On 12/17/2003 11:26 AM, LoneWolf wrote: I am parsing a massive file line by line and cleaning it up. It has about 15 fields, all separated by | and I want to remove the white space from before and after the pipes so that as the information is parsed it gets rid of external white spaces from the

get rid of whitespace around pipes??

2003-12-17 Thread LoneWolf
I am parsing a massive file line by line and cleaning it up. It has about 15 fields, all separated by | and I want to remove the white space from before and after the pipes so that as the information is parsed it gets rid of external white spaces from the string and such. Some fields are

Re: How do I set up bidirectional pipes over a network connection?

2003-12-10 Thread drieux
On Dec 10, 2003, at 5:54 AM, Dan Anderson wrote: [..] Actually, that's a good idea too. Thanks for your suggestions! -Dan while I like the NFS idea, you might want to look into the idea of a SAN/NAS device that is already hardened with fail over CPU's, etc, etc, etc... then as long as you keep al

Re: How do I set up bidirectional pipes over a network connection?

2003-12-10 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Dan Anderson) writes: >I'm writing a perl daemon to do two things: back up important files on >multiple boxen so if one gets taken out another will survive, and sync >files in users directory from a main server -- i.e. I want to be able to >do som

Re: How do I set up bidirectional pipes over a network connection?

2003-12-10 Thread Dan Anderson
On Tue, 2003-12-09 at 20:38, John W. Krahn wrote: > Dan Anderson wrote: > > > > On Tue, 2003-12-09 at 16:31, James Edward Gray II wrote: > > > On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: > > > > > > > I have 2 Linux boxes I want to talk to each other over the local > > > > network > > > > usin

Re: How do I set up bidirectional pipes over a network connection?

2003-12-10 Thread Dan Anderson
On Tue, 2003-12-09 at 17:41, James Edward Gray II wrote: > On Dec 9, 2003, at 4:12 PM, Dan Anderson wrote: > > > Well, I was planning to implement the file transfers using Net::FTP or > > something similar to keep the problems down. But I want every node to > > be able to talk to other nodes, i.e

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread John W. Krahn
Dan Anderson wrote: > > On Tue, 2003-12-09 at 16:31, James Edward Gray II wrote: > > On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: > > > > > I have 2 Linux boxes I want to talk to each other over the local > > > network > > > using a Perl script. Is it possible to set up a bidirectional pipe so

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 4:12 PM, Dan Anderson wrote: Well, I was planning to implement the file transfers using Net::FTP or something similar to keep the problems down. But I want every node to be able to talk to other nodes, i.e. each node be able to send every other node a request to download a file

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread Wiggins d Anconia
> > How many boxes are we talking about here? > > Well starting off, 2. But I would like to expand to several more. > Probably never more then 10. > > > What you're talking about is no small feat. How can we help you? > > > > You want a server and a client, right? Could it be and FTP serve

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread Dan Anderson
> How many boxes are we talking about here? Well starting off, 2. But I would like to expand to several more. Probably never more then 10. > What you're talking about is no small feat. How can we help you? > > You want a server and a client, right? Could it be and FTP server and > a script

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 3:40 PM, Dan Anderson wrote: On Tue, 2003-12-09 at 16:31, James Edward Gray II wrote: On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: I have 2 Linux boxes I want to talk to each other over the local network using a Perl script. Is it possible to set up a bidirectional pipe so

Re: How do I set up bidirectional pipes over a network connection ?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 3:49 PM, Dan Anderson wrote: You might look at the standard rdist(1) utility for this kind of thing. For crafting network daemons in Perl, Net::Daemon is a good place to start, IMO. What I am trying to do is too complex to successfully implement using a standard utility like

RE: How do I set up bidirectional pipes over a network connection ?

2003-12-09 Thread Dan Anderson
> You might look at the standard rdist(1) utility for this kind of thing. > > For crafting network daemons in Perl, Net::Daemon is a good place to start, > IMO. What I am trying to do is too complex to successfully implement using a standard utility like rdist or CVS. Besides, rolling my own is

RE: How do I set up bidirectional pipes over a network connection ?

2003-12-09 Thread Bob Showalter
Dan Anderson wrote: > On Tue, 2003-12-09 at 16:31, James Edward Gray II wrote: > > On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: > > > > > I have 2 Linux boxes I want to talk to each other over the local > > > network using a Perl script. Is it possible to set up a > > > bidirectional pipe so t

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread Dan Anderson
On Tue, 2003-12-09 at 16:31, James Edward Gray II wrote: > On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: > > > I have 2 Linux boxes I want to talk to each other over the local > > network > > using a Perl script. Is it possible to set up a bidirectional pipe so > > that 2 perl daemons can comm

Re: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 3:19 PM, Dan Anderson wrote: I have 2 Linux boxes I want to talk to each other over the local network using a Perl script. Is it possible to set up a bidirectional pipe so that 2 perl daemons can communicate with each other? How would I go about doing this and are there any m

RE: How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread Tim Johnson
Beginners Subject: How do I set up bidirectional pipes over a network connection? I have 2 Linux boxes I want to talk to each other over the local network using a Perl script. Is it possible to set up a bidirectional pipe so that 2 perl daemons can communicate with each other? How would I go about doin

How do I set up bidirectional pipes over a network connection?

2003-12-09 Thread Dan Anderson
I have 2 Linux boxes I want to talk to each other over the local network using a Perl script. Is it possible to set up a bidirectional pipe so that 2 perl daemons can communicate with each other? How would I go about doing this and are there any modules to help? Thanks in advance, Dan -- To

Re: Bidirectional pipes

2003-09-02 Thread Mehmet . Ekici
Hi, I have already using DBI module, I just wanted to explain with an example. Let think that I want to be root user and issue some command in that case I also need bidirectional pipes. su - root Password execute some commands here . Mehmet

Re: Bidirectional pipes

2003-09-02 Thread Sudarshan Raghavan
Subject: Re: Bidirectional pipes

Re: Bidirectional pipes

2003-09-02 Thread Mehmet . Ekici
reless.com> cc: Subject: Re: Bidirectional pipes

Re: Bidirectional pipes

2003-09-02 Thread Sudarshan Raghavan
[EMAIL PROTECTED] wrote: Hi all, I wonder how can I open pipe to STDIN and STDOUT of a process ? perldoc IPC::Open2 If you need a handle to STDERR perldoc IPC::Open3 Tnx. Mehmet -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Bidirectional pipes

2003-09-02 Thread Mehmet . Ekici
Hi all, I wonder how can I open pipe to STDIN and STDOUT of a process ? Tnx. Mehmet -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: help with pipes

2002-10-14 Thread david
you make a couple mistakes... see below... David Gerler wrote: > > > if ($OS eq "windows") { > $outfile = ".\\$scratchPad\\"."temp1.txt"; > $cmd = "c:\\gnupg\\gpg -ea -r ezbid > $outfile"; you are rediecting the output to a file. if you try to read from STDOUT again later, you won't see them..

Re: Help with pipes

2002-10-14 Thread david
David Gerler wrote: > I have successfully pipe a print statement to gpg. My problem is coming in > when I try to get it back out via a pipe. Can anyone tell me, is it > possible to send data to a another program and the output back with out > writing it to a file? > > This is my code to pipe it

Re: help with pipes

2002-10-14 Thread zentara
t back with out writing >it to >a file? Pipes are one-way devices, so you need to open 2 pipes, 1 for each direction. Here is a super-simple example of 2 way piping. Just start the a and b scripts below, and watch them talk. You don't need the mkfifo in each script, if you know which

RE: help with pipes

2002-10-13 Thread David Gerler
David Gerler <[EMAIL PROTECTED]> wrote: > I have successfully piped a print statement to gpg. My problem > is coming in when I try to get it back out via a pipe. Can anyone > tell me, is it possible to send data to a another program and the > output back with out writing it to a file? Try the st

Re: help with pipes

2002-10-13 Thread John W. Krahn
David Gerler wrote: > > I have successfully piped a print statement to gpg. My problem is > coming in when I try to get it back out via a pipe. Can anyone tell > me, is it possible to send data to a another program and the output > back with out writing it to a file? > > I want to change the met

Re: help with pipes

2002-10-13 Thread Steve Grazzini
David Gerler <[EMAIL PROTECTED]> wrote: > I have successfully piped a print statement to gpg. My problem > is coming in when I try to get it back out via a pipe. Can anyone > tell me, is it possible to send data to a another program and the > output back with out writing it to a file? Try the

help with pipes

2002-10-13 Thread David Gerler
I have successfully piped a print statement to gpg. My problem is coming in when I try to get it back out via a pipe. Can anyone tell me, is it possible to send data to a another program and the output back with out writing it to a file? I want to change the method of piping because of some stran

Help with pipes

2002-10-13 Thread David Gerler
I have successfully pipe a print statement to gpg. My problem is coming in when I try to get it back out via a pipe. Can anyone tell me, is it possible to send data to a another program and the output back with out writing it to a file? This is my code to pipe it to gpg: sub scramble { my $numbe

RE: Programming pipes to and from another program

2002-09-25 Thread Jeff AA
tember 2002 16:20 > To: Jeff AA > Cc: [EMAIL PROTECTED] > Subject: RE: Programming pipes to and from another program > > > > > >If *nix, look at help for the open3 function. Attached as a > text file is > > > >the little run class that I use to do

RE: Programming pipes to and from another program

2002-09-25 Thread Peter_Farrar
>If *nix, look at help for the open3 function. Attached as a text file is > >the little run class that I use to do this. > >Here is an example of how to use this class to encapsulate GPG, where >the passphrase gets written to stdin of the child process, and the >results are reaped from the child

RE: Programming pipes to and from another program

2002-09-25 Thread Bob Showalter
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 25, 2002 8:52 AM > To: [EMAIL PROTECTED] > Subject: Programming pipes to and from another program > > ... > Is there a simple (or even complex) way to open a tw

RE: Programming pipes to and from another program

2002-09-25 Thread Jeff AA
gt; From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: 25 September 2002 13:52 > To: [EMAIL PROTECTED] > Subject: Programming pipes to and from another program > > > Hi there, > > I hope this is a trivial newbie problem: > > I know how to open a pipe to anot

Programming pipes to and from another program

2002-09-25 Thread Peter_Farrar
Hi there, I hope this is a trivial newbie problem: I know how to open a pipe to another program: open (OUT, "|perl .\\bogus.pl") or warn "Unable to open pipe to bogus.pl\n"; print OUT "Stuff\n"; And I know how to open a pipe from another program: open (IN, "perl .\\bogus.pl|")

Re: named-pipes limited to 1 line?

2002-07-26 Thread zentara
On Thu, 25 Jul 2002 18:04:55 -0700, [EMAIL PROTECTED] (John W. Krahn) wrote: > >Unbuffer the FIFO handle as well: > >select FIFO; $| = 1; > >> #while(1){ #will not work in this loop > >This should work. What is it doing or not doing that you want it to? > Thanks John. It was th

named-pipes limited to 1 line?

2002-07-25 Thread zentara
Hi, I'm starting to check out IPC with named pipes. In the following example, my pipe-writer dosn't work from inside a loop. It only sends one line and then it all closes. Is this a limitation of named pipes? How do you keep the pipe open? First I create the named-pipe: #!/bin/sh mk

Re: Network Programming and the limiting factors - was Re: Multiple pipes going to the same file?

2002-05-15 Thread drieux
On Wednesday, May 15, 2002, at 06:33 , drieux wrote: > > volks, > sorry, but I forgot the simpler solution. change plank's constant it theoretically can speed things up a bit ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Network Programming and the limiting factors - was Re: Multiple pipes going to the same file?

2002-05-15 Thread drieux
volks, I do hope kevin will not mind that I take back onto the list a bit of Kvetching about 'faster, better, cheaper' - the way hot networking code - problem. This will get way Ugly and a bit technical so relax, get a mug of and a big cookie and curl up around the Fire as Uncle Drieux tells th

Multithreading? Two pipes processed at the same time

2002-05-14 Thread Kevin O
Hello all, I posted a question the other day wanting to write 2 pipes to the same file. While I cannot do that, I'd like to do something else. I have 2 pipes with streaming data and I need them written to different files at the same time. I have this: open(PIPE1, "strea

Re: Multiple pipes going to the same file?

2002-05-09 Thread drieux
On Thursday, May 9, 2002, at 05:02 , Kevin Old wrote: [..] > I have 3 [file handle] pipes of streaming data that need to write to > the same file..can it be done? yes. > If so, how? you might want to review perldoc -f select and go back of how to implement the standa

Multiple pipes going to the same file?

2002-05-09 Thread Kevin Old
Hello all, I have 3 [file handle] pipes of streaming data that need to write to the same file..can it be done? If so, how? Thanks, Kevin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to open PIPES

2002-01-30 Thread Jenda Krynicky
From: "Agustin Rivera" <[EMAIL PROTECTED]> > Ah...pipes. I know this has been asked a hundred times, too, but the > word comes up so much it's hard to make a search on. > > I have a telnet program that is capable of letting other programs >

How to open PIPES

2002-01-30 Thread Agustin Rivera
Ah...pipes. I know this has been asked a hundred times, too, but the word comes up so much it's hard to make a search on. I have a telnet program that is capable of letting other programs utilize it's STDIN and STDOUT. So, how do I open the program and pipe the data into and to a P

Re: Pipes

2001-12-28 Thread Paul Johnson
On Fri, Dec 28, 2001 at 11:21:04AM -0800, Mariana Añez wrote: > > Hi > How can i do a pipe program with perl? > I mean I want to make a program it can be used like this: > > ls | myprogram | ps Just take your input from STDIN and send your output to STDOUT, although in general you won't n

RE: Pipes

2001-12-28 Thread Hanson, Robert
--Original Message- From: Mariana Añez [mailto:[EMAIL PROTECTED]] Sent: Friday, December 28, 2001 2:21 PM To: [EMAIL PROTECTED] Subject: Pipes Hi How can i do a pipe program with perl? I mean I want to make a program it can be used like this: > ls | myprogram | ps Is using "

Pipes

2001-12-28 Thread Mariana Añez
Hi How can i do a pipe program with perl? I mean I want to make a program it can be used like this: > ls | myprogram | ps Is using “open” the only way? Thanks in advance and HAPPY HOLIDAYS Mariana C. Añez Salaverria --- Sync Consultores c.a. www.syn