Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread GMane Python
Thank you for the reply to my topic, not BASH wars, but does this look correct? use IO::Socket; use strict; use Time::HiRes qw( time alarm sleep ); $server_ip = 'localhost'; $server_port = 43278; $microseconds = 5_000_000; while ( ) { my $message =

Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread JupiterHost.Net
GMane Python wrote: Thank you for the reply to my topic, not BASH wars, but does this look correct? use IO::Socket; use strict; use Time::HiRes qw( time alarm sleep ); $server_ip = 'localhost'; $server_port = 43278; $microseconds = 5_000_000; You need to do my $server_ip ... etc with use strict;

Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread GMane Python
I'm having a bit of trouble so far. The code below is what I've found on different web sites as being the functions I believe I need: use IO::Socket; use strict; use Time::HiRes qw( time alarm sleep ); while ( ) { my $message =

Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread GMane Python
Yes, but I posted a wrong file. This one doesn't work at all. I have another that seems to work, but doesn't register on my Python heartbeat server. It's posted as a reply to Dave just above. Sorry about the wrong file. -Dave JupiterHost.Net [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread GMane Python
It does not compile on Netware, but it's OK on Windows. For Netware, I copied from my Windows PC the perl/lib and perl/site directories to Netware because Sockets::IO was not found. Now, I get: Missing $ on loop variable at sys:\perl\lib/strict.pm li BEGIN failed--compilation aborted at

Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread Dave Gray
On Wed, 29 Dec 2004 12:50:21 -0500, GMane Python [EMAIL PROTECTED] wrote: while ( ) { That isn't doing what you expect, which (I assume) is an infinite loop. loops over @ARGV and attempts to open each arg as a file and iterate over the lines in each. I suppose it is functionally a somewhat

RE: Can someone translate a small .PY to Perl?

2004-12-28 Thread Bakken, Luke
Or more commonly: while :; do ... done because the : command is true. It works for me. That's the way I'd seen it done when I was learning bash. I believe the while checks the return value, not the output of the command. Just be thankful

Re: Can someone translate a small .PY to Perl?

2004-12-28 Thread Dave Gray
was wondering if there were a translation in PERL so I could have my Netware servers send heartbeats to the heartbeat server? Title: PyHeartbeat - detecting inactive computers Submitter: Nicola Larosa # Filename: HeartbeatClient.py Heartbeat client, sends out an

Re: Can someone translate a small .PY to Perl?

2004-12-28 Thread Randal L. Schwartz
Andrew == Andrew Gaffney [EMAIL PROTECTED] writes: Andrew It works for me. That's the way I'd seen it done when I was learning Andrew bash. I believe the while checks the return value, not the output of Andrew the command. That's a bash-ism then, not The One True Shell. I was using The One

Can someone translate a small .PY to Perl?

2004-12-27 Thread GMane Python
Hello Everyone. Whil e reading the Python Cookbook as a means of learning Python, I came across the script by Nicola Larosa. Not knowing anything about PERL, I was wondering if there were a translation in PERL so I could have my Netware servers send heartbeats to the heartbeat server?

Re: Can someone translate a small .PY to Perl?

2004-12-27 Thread Andrew Gaffney
GMane Python wrote: Hello Everyone. Whil e reading the Python Cookbook as a means of learning Python, I came across the script by Nicola Larosa. Not knowing anything about PERL, I was wondering if there were a translation in PERL so I could have my Netware servers send heartbeats to the

Re: Can someone translate a small .PY to Perl?

2004-12-27 Thread Andrew Gaffney
S. David Rose wrote: Sorry, sir. I did not state it boldly enough, but this is to be used on a Netware server. There is no port for Python on Netware, but PERL is available. Obviously, bash scripting will not work It's Netware 5.0 / 5.1 for my servers. Ah, sorry. I didn't catch that part.

Re: Can someone translate a small .PY to Perl?

2004-12-27 Thread Randal L. Schwartz
Andrew == Andrew Gaffney [EMAIL PROTECTED] writes: Andrew while `/bin/true`; Uh, what? Execute /bin/true, take its output if its output is non-null, continue. Last I checked, /bin/true outputs nothing. :) Maybe you wanted: while true; do; ...; done Or more commonly:

Re: Can someone translate a small .PY to Perl?

2004-12-27 Thread Andrew Gaffney
Randal L. Schwartz wrote: Andrew == Andrew Gaffney [EMAIL PROTECTED] writes: Andrew while `/bin/true`; Uh, what? Execute /bin/true, take its output if its output is non-null, continue. Last I checked, /bin/true outputs nothing. :) Maybe you wanted: while true; do; ...; done Or