in reply to (jcwren) Re: sending data between CGI scripts
in thread sending data between CGI scripts

the idea is that someone requests the main script. this script then uses other scripts to get some information. the first script is running and calls the other scripts to get information. i'm not sure it'll work out the way i planned it though. as for login.pl, it was just a temporary name to give the script so i have some idea whats going on in my program... it would have been changed long before i actually used it for anything important.
  • Comment on RE: (jcwren) Re: sending data between CGI scripts

Replies are listed 'Best First'.
(chromatic) RE: RE: (jcwren) Re: sending data between CGI scripts
by chromatic (Archbishop) on Jul 19, 2000 at 01:37 UTC
    I usually use modules for this purpose. (See perlmod for groovy details.) My main CGI is pretty simple:
    #!/usr/bin/perl -wT use strict; use SuperModule; use CGI; my $q = CGI->new(); # magic here my %actions = ( login => \&do_login, post => \&do_post, pyro => \&set_someone_on_fire ); my $action = $q->param('action'); if (defined $actions{$action}) { $actions{$action}->($q); } else { default_page($q); } sub do_login { # check login parameters here my $q = shift; SuperModule::login($q); # or whatever }
    ...and so forth. It's a layer of abstraction, to be sure, but if you want to put the whole script into your httpd.conf file, it makes mod_perl'ing it a lot easier.
RE: RE: (jcwren) Re: sending data between CGI scripts
by lhoward (Vicar) on Jul 18, 2000 at 20:57 UTC
    If the first script needs to call other .cgi scripts, tehn you want to use LWP. If the cgi script is just calling other scripts then you can just system or open it with a pipe.