|XP is just a number|
Using Modulesby Anonymous Monk
|on Oct 13, 2007 at 01:43 UTC||Need Help??|
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I built our website to be 100% automated and dynamic, including adding additional merchant accounts.
I created an administrative back office to manage the website, including adding new merchant accounts.
I was building it where they had the same subroutine in the file, named: chargeCard.
Then I named the file the name of the database Name, and then when it picked the Merchant Account to use I would do a require:
however, we have a 25M limit with one bank that the gateway is a custom gateway that does not support discover cards yet, so I have my programming pick one of the authorize.net accounts we have if it is a discover card and then all others go to the main merchant account.
Now we discovered that we are getting about 30 declines per day, which when we force them to one of the authorize.net accounts it is approved 9 out of 10 times.
So now I want to use BOTH in the instance that the first one is declined. In view of that I made them modules.
My question is this, how can I pull them in, if the file to use is a variable:
Of course with that I get an error: syntax error at /path/to/subs.data line 174, near "use MA::$_madType"
I've also tried that code with this 'use' statement:
I get the same errors every time.
So How can I do this with a variable name, so that I can pull in several files at one time and call them like this:
I'd appreciate any assistance or pointers you have for me.