Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: CGI

by hiseldl (Priest)
on Oct 01, 2002 at 14:35 UTC ( [id://202012]=note: print w/replies, xml ) Need Help??


in reply to Calling a CGI script from a CGI script (was: CGI)

If your first CGI is modular, e.g. it has a sub you can call that produces results, you could add a "1;" to the end of the script, then require it into your first CGI and call the sub. Or you can wrap the body of the script into a sub and then require/import and call your sub.

For example, I had a few small scripts where I wrapped them in a sub something like:

#!perl -wT use strict; use CGI; # use more modules; &mysub1(); exit 0; sub mysub1 { # the body of the script } 1;
and then used CGI::Application to call the wrapped methods as run modes. If you can't install CGI::Application, you should still be able to require/import the scripts and call the methods directly.

--
hiseldl
What time is it? It's Camel Time!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://202012]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found