> -Original Message-
> From: John W. Krahn [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 23, 2005 2:50 PM
> To: Perl Beginners
> Subject: Re: printing output of ping command -- New question
> at bottom.
>
> Tyson Sommer wrote:
> >
> > Th
> -Original Message-
> From: Chris Devers [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 23, 2005 1:18 PM
> To: Tyson Sommer
> Cc: 'Perl Beginners List'
> Subject: Re: printing output of ping command -- New question
> at bottom.
>
> On
Tyson Sommer wrote:
This might be a question for beginners-cgi, but since it was mentioned
here...
I tried to use Net::Ping in a CGI script and it said I didn't have
permissions to run ping. I can execute the section of the CGI script with
the call to Net::Ping just fine from the cmd line as a regu
On Wed, 23 Feb 2005, Tyson Sommer wrote:
> This might be a question for beginners-cgi, but since it was mentioned
> here...
Sounds like it, but oh well.
This doesn't really fix your problem so much as your error handling, but
why aren't you catching the reason your script dies?
Instead of
> -Original Message-
> From: Chris Devers [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 23, 2005 10:14 AM
> To: TapasranjanMohapatra
> Cc: Perl Beginners List
> Subject: Re: printing output of ping command
>
> On Wed, 23 Feb 2005, TapasranjanMohapatr
On Wed, 23 Feb 2005, TapasranjanMohapatra wrote:
> I have a script as follows
>
> my $host = shift;
> my $count = shift;
> my $result = `ping -c $count $host`;
> if($result =~ m/$count packets transmitted, $count packets received/)
> {
> $success = 1;
> }
> print "$re
TapasranjanMohapatra wrote:
Hi All,
I have a script as follows
my $host = shift;
my $count = shift;
my $result = `ping -c $count $host`;
if($result =~ m/$count packets transmitted, $count packets received/)
{
$success = 1;
}
print "$result\n";
--
This works:
#!/usr/bin/perl
use strict;
use diagnostics;
my $host = "www.netbsd.org";
my $count = 0;
system("ping -c 5 $host");
=
thx,
Radhika
> Hi All,
> I have a script as follows
>
> my $host = shift;
> my $count = shift;
> my $result = `ping -c $coun
Hi All,
I have a script as follows
my $host = shift;
my $count = shift;
my $result = `ping -c $count $host`;
if($result =~ m/$count packets transmitted, $count packets received/)
{
$success = 1;
}
print "$result\n";
Now, when I run the scr