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 = )
> > {
> >
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
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
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
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
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
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
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: $_
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>
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
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
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
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
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
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
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
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
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
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
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
> > 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
> 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
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
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
> 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
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
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
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
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
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
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
Subject: Re: Bidirectional pipes
reless.com> cc:
Subject: Re: Bidirectional pipes
[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]
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]
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..
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
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
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
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
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
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
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
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
>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
> -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
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
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|")
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
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
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
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
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
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
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]
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
>
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
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
--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 "
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
60 matches
Mail list logo