Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

ping me when you'er ready!

by halxd2 (Monk)
on Dec 13, 2000 at 01:34 UTC ( [id://46332]=CUFP: print w/replies, xml ) Need Help??

Don't ya just love perl? The network was down and I was waiting to work on one of my servers. Friday late, I wanted to go home. So I stamped out this little one line to send a qpage to me when it saw my server. I could go home and relax knowing I'd hear when the network was ready!
Fast Update: I was wondering if 'while' was the best loop for the job. So I tried a 'for' loop and look what I got!
for($?=1;$?>0;`ping penn`){sleep 900}`qpage hck "penn now up"`;
As I walked out of the office last night that a 'while' loop could do it better with less code.
while(`ping penn`){sleep 900}`qpage hck "penn is up"`;'
perl -e 'while(1){`ping penn`;if(0==$?){`qpage hck "Penn is up\!"`;exi +t;}sleep 900;}' &
Or...
perl -e 'for($?=1;$?>0;`ping penn`){sleep 900}`qpage hck "penn now up" +`;'
</CODE>Or...
perl -e 'while(`ping penn`){sleep 900}`qpage hck "penn is up"`;'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://46332]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found