Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 having an uproarious good time at the Monastery: (5)
As of 2015-07-05 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls