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: Re: [srhadden] Using require to redirect a cgi script: Edit Log



wickedxter
User

Jun 24, 2012, 4:26 PM


Views: 2037
Re: [srhadden] Using require to redirect a cgi script

I dont think thats is the best way, it could work and then break later...

I would require both modules in and then compare what ever then, based on that use what ever sub from the modules... are the modules really large ?? if they are you can import only sub's from them if need be rather then everything...

also use the code blocks provided...


do these modules have the same name sub's?


Heres and example of what im talking about....

Code
use strict; 
use warnings;
use CGI;
require "custom_signon1.pm";
require "custom_signon2.pm";

my $cgi = new CGI;

my $user = params->{'UserName'};
my $password = params->{'PassWord'};
my $date_time = params->{'date_time'};

if(x) {
#use sub from custom_signon1.pm
SIGN_ON1($user,$password,$date_time);
}
elsif(y) {
#use sub from custom_signon2.pm
SIGN_ON2($user,$password,$date_time);
}



(This post was edited by wickedxter on Jun 24, 2012, 4:29 PM)


Edit Log:
Post edited by wickedxter (User) on Jun 24, 2012, 4:29 PM


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

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