I have also learned that porting things from languages with different structures is a bag of worms. For example:
1. ColdFusion is apparently case insensitive. So the code I was porting from has things like setErrorMessage and SetErrorMessage. In Perl those are NOT the same thing, Perl being case sensitive and all. I tripped over a few of those. I need to sit down with my boss (he who does the ASP & CF) and normalize our variable naming scheme so this shit doesn't happen.
2. Since the two existing implementations are ASP and CF, I'm working from both as a basis. Unfortunately neither one is a straight port of the other - both have diverged a little from small fixes, etc. And some of the function names are different, so I've found places where I used the CF name once, and the ASP elsewhere, which is annoying.
3. CF and ASP seem to have a very different namespace than Perl. pcFunctions uses a function in Merchant, and Merchant uses functions in pcFuctions... That seems to automatically work in CF and ASP. But Perl gets snippy if I try to do a 'use pcFunctions' in Merchant and a 'use Merchant' in pcFunctions. It doesn't seem to like the recursion (not that I blame it, I don't either). My restriction is that I need to keep the ported structure as close to the original as possible so that the same docs can be used for all the languages. Otherwise I'd look at shuffling everything into more of a direct tree instead of the back-and-forth referals. For now I've gotten around it by using explicit package referals on the calls - pcFunctions::functioname. If anyone has a good way to make the recusive 'use' work, I'd love to hear it.
I'm just glad that it is starting to work. If I get these functions working, I have one large file left to port and the basic PayCash functionality should be done. Then I get to start porting the Kiosk code, which means XML parsing. I'm leaning towards libXML for the DOM support, but I'm open to suggestions on that - I've never worked with XML in Perl, so any module I use will be new to me anyway.