in reply to Array Problem

Well, I wrote a similar test program for my linux machine to test the status of our network printers. It's a simple snippet of code.
#!/usr/bin/perl -w use strict; my $ip = '10.195.16'; open( 'FH' , ">printer_ping"); for ( 30 .. 200 ) { my $test = join('.',$ip,$_); print "Now pinging $test\n"; my $output = `ping -c 2 $test`; print $output; print FH $output; }
The nice thing about this code is that it prints both to standard output, and to file, and can be easily modified to print anywhere else.
Theodore Charles III
Network Administrator
Los Angeles Senior High
email->secon_kun@hotmail.com
perl -e "map{print++$_}split//,Mdbnr;"

Replies are listed 'Best First'.
Re^2: Array Problem
by wanderinweezard (Initiate) on Jul 08, 2005 at 18:54 UTC
    That's great, it works really well. I'm trying to simplify the output into basically IP Address: Result... So, I was wanting to, using your example, pass $output through a check and see if it contains either the word "Reply" or the word "Request"... Is it possible to do something like this?

    I am not sure how to make the (m/Reply/) check if that is inside the $output variable?