I have written a simple script that runs file when I run on command line
but fails when I redirect its output

I cant beleive this , it seems so impossible can anyone help me

$!=1;
use Net::Ping;
@host_array = <DATA>;
$p = Net::Ping->new("icmp");
$p->bind("192.168.2.211"); # Specify source interface of pings
foreach $host (@host_array)  {
  chomp($host);
  print "$host is ";
  print "NOT " unless $p->ping($host, 2);
  print "reachable.\n";
}
$p->close();
__DATA__
192.168.2.1
192.168.2.21
192.168.2.25
192.168.2.212
192.168.2.213
192.168.2.214
192.168.2.215
192.168.2.211
127.0.0.1
192.168.2.144
192.168.2.100
192.168.2.101


When I run the above script it runs fine like this perl ping1.pl

when I do
perl ping1.pl >output
I get nothing on screen
the file output  is also empty 8-(


Now How can this happen


Thanks
Ram





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to