in reply to Business::OnlinePayment sub redefined warnings

I looked at the code which required the "patch".
$ perl -MBusiness::OnlinePayment -we 'for( 1..2 ) { \ my $tx= Business::OnlinePayment->new('AuthorizeNet'); }'
From what I can tell, this is not a bug, because you are trying to redefine $tx as you work thru the loop.

Usually when you use multiple instance of a module, you name your "instances of the module" differently, like $tx and $tx1. Usually you would use a hash, like

my %tx; for(1..2){ $tx{$_}{'object'}=Business::OnlinePayment->new('AuthorizeNet'); }
The other technique is to only have 1 B::OP object going at any one time, and undef it at the end of each processing loop.

But I havn't actually tried the module, so I may be missing something. ;-)


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Business::OnlinePayment sub redefined warnings
by perrin (Chancellor) on Jun 04, 2005 at 14:19 UTC
    You are missing something. The variable names are irrelevant -- you get the same warnings if you use different variables. It's also perfectly legal to overwrite a variable with a new instance of an object, but that has nothing to do with the bug.