-----Original Message----- From: Beginner [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 21, 2006 12:16 PM To: beginners@perl.org Subject: RE: uninitialized value error
On 21 Jun 2006 at 17:08, Beginner wrote: > for (;<PS>;) { > print SDTERR "PS=$_\n"; > push @arry, (split)[1]; > } of course that should read print STDERR "PS=$_\n"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> ********************************************************************** I tried the standard error print and this is revealing the same: 60 open (PS, "ps -ef|grep /usr/sbin/[n]amed |") or die "not spawn p s $!"; 61 for (;<PS>;) { 62 print STDERR "PS=$_\n"; 63 push @arry, (split)[1]; 64 } 65 print $arry[0],"\n"; 66 print scalar @arry,"\n"; 67 68 if (scalar defined @arry < 1) { 69 print LOG "named was not running, now restartng\n", dateme(); 70 system ("echo named dubdns02|mailx -s named $oncall"); 71 system ("/sbin/init.d/named start"); 72 } 73 print $arry[0],"\n"; 74 75 open (PSO, "ps -p$arry[0] -o vsz |") or die "unable to spawn ps - p $!"; 76 77 foreach (<PSO>) { 78 if (/\d+/) { 79 if ($_ >= VSZ) { 80 print LOG "named vsz reached over 60mb",$_,"now stoppi ng & starting\n"; 81 print LOG dateme(),"\n"; 82 namedchk(); 83 } 84 else { 85 exit 1; 86 } 87 } 88 } 89 90 close (PS) or warn "Did not close FH ps $!"; :q! __OUTPUT__ csdns03# perl named_monit.pl PS=root 7431 1 0 10:51:38 ? 18:48 /usr/sbin/named 7431 1 7431 _________________________________________________ This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. Dansk - Deutsch - Espanol - Francais - Italiano - Japanese - Nederlands - Norsk - Portuguese - Svenska: www.cardinalhealth.com/legal/email -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>