Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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.

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 studying the Monastery: (11)
As of 2016-10-27 13:32 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (362 votes). Check out past polls.