in reply to Re^3: Using Modules
in thread Using Modules

I figured it out...

I'm not going to use them as modules... Since I have to build the gateway subroutine named chargeCard, I would just name it the name of the file + chargeCard, then when I pull the gateway to use out of the database, I'll call that subroutine that way:
my ($_merid,$_mertype) = $dbh->selectrow_array(qq{SELECT `id`,`type` F +ROM `merchants` WHERE #SomeWhereStatement#}); require "/path/to/modules/$_mertype.conf"; my $_subvar = $_mertype . "chargeCard"; my $cardCharged = &$_subvar($_merid);
and that does work... so now all I have to do is when I program each gateway, I just have to add it to the database first, figure out what type I made it then add that type to the forefront of the chargeCard subroutine name. And that will make them all dynamic, where I can use more than one at the same time... in case one gateway declines the transaction for some dumb reason other than no funds available.

Just thought I'd update this so people do not have to waste their time reading and trying to help me.

thx,
Richard