Proposed correction

2012-09-16 Thread jmrhide-perl
for (my $loopiter = 0; $loopiter < $loopmax; $loopiter++) { #1 if ($loopiter >= ($loopmax - 1)) { die "Loop number $loopnum has iterated $loopiter times" } $termnum[0] = int( rand($defnum) ); last unless ( $termnum[0] == $lastnum ); }

Re: Fw: Proposed correction for my long script

2012-09-16 Thread Uri Guttman
On 09/16/2012 09:34 PM, jmrhide-p...@yahoo.com wrote: I copied what was on the manpage for CGI::carp I lost my way on that one, but I don't see how a shuffle works here either. I'm trying to ensure that the program will not pick the same term twice in a row. $lastnum comes from a cookie and re

Re: Fw: Proposed correction for my long script

2012-09-16 Thread jmrhide-perl
I copied what was on the manpage for CGI::carp I lost my way on that one, but I don't see how a shuffle works here either. I'm trying to ensure that the program will not pick the same term twice in a row. $lastnum comes from a cookie and refers to the previous question. What about for (my $lo

Re: Fw: Proposed correction for my long script

2012-09-16 Thread Uri Guttman
On 09/16/2012 07:40 PM, jmrhide-p...@yahoo.com wrote: I guess I've been vague again. I was really hoping for somebody to cast an eye on the subroutines I added earlier today. My intention was to (1) prevent any infinite looping and (2) get notification if one of the loops misbehaves. Did I make a

Fw: Proposed correction for my long script

2012-09-16 Thread jmrhide-perl
I guess I've been vague again. I was really hoping for somebody to cast an eye on the subroutines I added earlier today. My intention was to (1) prevent any infinite looping and (2) get notification if one of the loops misbehaves. Did I make any obvious logical or grammatical errors in the snipp

Re: My long script

2012-09-16 Thread Rob Dixon
On 16/09/2012 05:03, Robert Wohlfarth wrote: On Sat, Sep 15, 2012 at 4:46 PM, wrote: The user clicks on a button ("A" or "B"), which fires back a string that reawakens the script and shows it what answer the user chose. The script inspects the cooky-jar to determine the state of the script,

Re: Proposed correction for my long script

2012-09-16 Thread Uri Guttman
On 09/16/2012 03:46 PM, jmrhide-p...@yahoo.com wrote: OK, here's my amateurish attempt at a correction: i know you said you don't want to learn to be a professional coder. but there are so many ways to improve your code little by little. most here have been shying away for good reason and bec

Re: Proposed correction for my long script

2012-09-16 Thread Peter Scott
On Sun, 16 Sep 2012 12:46:08 -0700, jmrhide-perl wrote: > Does it look OK? This is a prime example of something that a test harness would be very useful for, then we'd all know the answer. There may be some entirely different reason why your provider thinks this script is consuming excessive re

Proposed correction for my long script

2012-09-16 Thread jmrhide-perl
OK, here's my amateurish attempt at a correction: #!/usr/local/bin/perl use warnings; use strict; use diagnostics; use CGI; my $cgi = new CGI; use Mail::Sendmail; use CGI::carp qw(set_die_handler); BEGIN { sub handle_errors { my $msg = shift; sendmail( From => 'i...@the

Re: My long script

2012-09-16 Thread Paul Anderson
On 2012-09-15, at 11:25 PM, jmrhide-p...@yahoo.com wrote: > It would be WONDERFUL to get an email every time it glitched! Does anybody > have > a > > > sub written for that? Just bear in mind that you need to add logic to the while(1) loops to determine that they are running too long. If it

Re: File/string formatter script?

2012-09-16 Thread newbie01 perl
Thanks Rob, The lines get broken when for example, /u01/app/oracle/admin/db01/adump becomes /u01/app/oracle/admin/db1234/adump or /u01/app/oracle/admin/db01/diagnosis and in most cases, I will manually edit the file to line them up. I know it is mostly for aesthetic purpose lining them up. Your s