in reply to Array Problem
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.#!/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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array Problem
by wanderinweezard (Initiate) on Jul 08, 2005 at 18:54 UTC |