Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: how to call perl-cgi from another perl-cgi?

by izut (Chaplain)
on Nov 07, 2006 at 10:41 UTC ( #582606=note: print w/replies, xml ) Need Help??


in reply to how to call perl-cgi from another perl-cgi?

Maybe you want to be more specific about your need. You might want to create a module for the code contained in your perl2.cgi file. Something like that (untested):

MyModule.pm:

package MyModule; sub something { my ($param) = @_; # do something here } 1;

perl1.cgi:

use MyModule; use CGI; # process something here... my $result = process_something_here(); MyModule::something($result);

perl2.cgi

use MyModule; use CGI; # process other thing here... my $result = process_other_thing_here(); MyModule::something($result);

Maybe you have to think about your problem. Maybe you want to share a specific part of your perl2.cgi file. If you want that, create a module (perlmodlib) and share that. It is better than glueing a lot of CGI's together.

Hope that helps.

Igor 'izut' Sutton
your code, your rules.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-02-26 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?