Re: Need help with if statement - please

2002-02-22 Thread Shaun Fryer
> 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

Re: Need help with if statement - please

2002-02-22 Thread David Wall
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

Re: Need help with if statement - please

2002-02-21 Thread Chris
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

Re: Need help with if statement - please

2002-02-21 Thread David Wall
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

Re: Need help with if statement - please

2002-02-21 Thread Chris
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] >

RE: Need help with if statement - please

2002-02-21 Thread Nikola Janceski
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

Need help with if statement - please

2002-02-21 Thread Chris
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:' ) {