Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: perl need to do until on qx{tracert $ip}

by NetWallah (Abbot)
on Sep 14, 2012 at 17:04 UTC ( #993758=note: print w/ replies, xml ) Need Help??


in reply to perl need to do until on qx{tracert $ip}

Do you really want to run 'tracert' multiple (possibily infinite) times ?

I'm guessing this is what you are want:

my $found = 0; for (qx<tracert $ipaddy>){ next unless /myhost/; found = 1; last; }
or, simpler,
if (grep {/myhost/}, qx<tracert $ipaddy>){ #Do something }else{ #Addr was not found in trace }

             I hope life isn't a big joke, because I don't get it.
                   -SNL


Comment on Re: perl need to do until on qx{tracert $ip}
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-08-20 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls