PDA

View Full Version : Perl/CGI - Autoresponder


jsebastian168
08-13-2006, 07:54 PM
I need some assistance in configuring an autoresponder - currently it is set to accept only 2 messages (the first and last) anything above that the messages are ignored:


*** If I have two messages, it says "message 1" and "message 2."
**** If I add a 3rd message, it has "message 1," "message 3," "message 3."

**** If I add a 4th message, it says "message 1," "message 4," "message 4," "message 4."

Attached is the ar.cgi as ar.txt please advise on how to increase the number of messages. Thanks for any assistance.

KevinADC
08-13-2006, 08:12 PM
over 1000 lines of code..... maybe someone else will want to sift through all that code.

DELOCH
08-14-2006, 07:02 PM
I made a script for you!

#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);

print header();

my @msg = (
'Message0' # Add messages like ", Cookies, Sender, Magic"
);
foreach(@msg) {
print("$_\n<br />"); # Print the message + new Line + Line Break
}

Hope it helps ^_^

FishMonger
08-14-2006, 09:01 PM
I don't have a problem with the length of the script as much as Kevin does, but after looking over this script (and the others that you emailed me) it's apparent the it falls into the realm of spaghetti code. Which means that it lacks logical flow, has virtually no code comments to explain what it's doing and why, and overall is poorly written. The only portion that is written well is the Lite.pm module that it uses, and that's because that module was written by others that knew what they were doing. However, the Lite.pm module that they are using is an older outdated version, and there have been many improvements to it since that version.

In order to resolve the problem you're having, I'd need to install it on my system then step through the code with a debugger and analize the flow of code. Unfortuneatly, that takes more time than I can justify spending. I think it's time for the person that you are helping to contact the company that wrote that package, or pay someone to troubleshoot it.

KevinADC
08-14-2006, 09:58 PM
spaghetti code

hehehe... may I borrow that description for future reference? :D

jsebastian168
08-14-2006, 10:48 PM
Thanks for taking a look at this. Sorry if I wasted your time.

FishMonger
08-14-2006, 10:59 PM
Don't worry, you didn't waste our time. I wish we could have given more help, but without having prior experience with that script, debugging it would take more work than is normally done in these types of forums.

If your friend wants to look into other avenues, here's a link to a site that should be able to resolve this for you.

http://rentacoder.com/RentACoder/default.asp

DELOCH
08-15-2006, 01:04 AM
Well.. at least i tried to help

note: I do not write much comments since I freely read it, when i want to keep it in mind i comment so i don't forget :)

jsebastian168
08-15-2006, 07:29 AM
Deloch,

Sorry - thanks for your assistance as well. I haven't tested out your code but since this script is quite long and causing other problems as well - we are looking at using something else. Thahks again.

DELOCH
08-15-2006, 02:49 PM
No harm done, took me 30 seconds to make that code ^_^