Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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.

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2015-11-26 10:37 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (697 votes), past polls