> Not sure if the Net::Ping will give me what I really need...
>
> What you saw is a VERY small part of the program, and all I wanted
> to do was give some realistic status, visually, "realtime".
>
> It is all being logged to a file, and that output MUST be exactly
> like standard PING output. T
Chris <[EMAIL PROTECTED]> wrote on 21 Feb 2002:
>> print "4 pings, $count were successful\n";
>>
>
> Not sure if the Net::Ping will give me what I really need...
>
> What you saw is a VERY small part of the program, and all I
> wanted to do was give some realistic status, visually, "realti
David Wall wrote:
> Chris <[EMAIL PROTECTED]> wrote on 21 Feb 2002:
>
>
>>if ( substr(@result[$Pcount],0, 12) == 'Packets:' ) {
>>
>
> How about
>
> if ( substr($result[$Pcount],0, 12) eq 'Packets:' ) {
>
> $result[$Pcount] is a scalar, not an array.
>
> or
>
> if ( $resul
Chris <[EMAIL PROTECTED]> wrote on 21 Feb 2002:
> if ( substr(@result[$Pcount],0, 12) == 'Packets:' ) {
How about
if ( substr($result[$Pcount],0, 12) eq 'Packets:' ) {
$result[$Pcount] is a scalar, not an array.
or
if ( $result[$Pcount] =~ /^\s+Packets:/ ) {
But I think
Nikola Janceski wrote:
> don't use == for string comparison. Use eq in place of the ==
>
> see:
> perldoc perlop
>
>
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 21, 2002 10:22 AM
> To: [EMAIL PROTECTED]
>
don't use == for string comparison. Use eq in place of the ==
see:
perldoc perlop
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 10:22 AM
To: [EMAIL PROTECTED]
Subject: Need help with if statement - please
Greetings listers,
I hav
Greetings listers,
I have the following code snippet:
my @result;
@result =`ping $hostname`;
my $aPing = @result;
my $Pcount = 0;
$Status = $entryS->Entry->delete("1.0", "end");
while ($aPing > 0){
print DUMPFILE "* @result[$Pcount]";
if ( substr(@result[$Pcount],0, 12) == 'Packets:' ) {