http://www.perlmonks.org?node_id=993758


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