CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Two Scripts, two jobs, one form

 



cd001
stranger

Jun 20, 2001, 8:34 AM

Post #1 of 3 (817 views)
Two Scripts, two jobs, one form Can't Post

I've searched through posts and I haven't found an answer, so I hope I'm not asking an obvious an previously answered question....

ok... I have a script which reads information from a form and sends out an invoice to the sender and a copy to the receiver (two different email addresses). The format of the email is HTML. The script (Alienform) works really well.

Now, I'd like to add the function of using the same information from the same form to not only send out the emails, but to send the information to a flat database. I have a script that generates my databases and it works well.

I can get the form to send the information to either script, but I don't know how to get the information to pass from one to the other.

I assume it has something to do with the system() function, but I don't know where to put it or the syntax to use. Would it be better to write a different script that would pass the raw information to the other two scripts? Can I do get the form itself to pass the information to the two scripts?

Any help would be appreciated, I'm a relative newbie when it comes to Perl....

Cheers...........cd



Mortimer
journeyman

Jun 20, 2001, 11:35 PM

Post #2 of 3 (805 views)
Re: Two Scripts, two jobs, one form [In reply to] Can't Post

You should think about merging your scripts, or even better, requiring functions from library files, or even better, using methods from modules. Use system() to call your system's programs, (I suppose that's why they called it system() !), but only when you really need to because it'll slow your program down. And if you do whatever you can with Perl, your programs will be so much more portable.

Cheers,
Dave.
www.dmscripts.com
davemortimer@bigpond.com



cd001
stranger

Jun 21, 2001, 8:24 AM

Post #3 of 3 (797 views)
Re: Two Scripts, two jobs, one form [In reply to] Can't Post

I like the idea of merging the two scripts, but, being the rookie that I am, I'm not too sure how to go about that...

I have already tried to do this by making the emailing script a subroutine, but the script hangs. I assume that I have at least caused the main script go to that subroutine, since I don't get an actual system died kind of screen (error 500?).

Do you, or anyone else, have a suggestion as to the things I need to look for when merging two scripts? Is it possible that the two scripts parse the form information differently? Should I look at that?

Thanks in advance...


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives