MegaZone (zonereyrie) wrote,
MegaZone
zonereyrie

  • Mood:
  • Music:

Progress can be made...

I've been working on this Perl port on and off for well over a month. Technically it is my primary task - except that all these other things keep popping up as super-critical tasks that take priority. So I've really only had a handful of days to *focus* on this, usually I've got a few minutes here and there to port things. And until tonight it has been a blind port - tonight I finally got enough ported to actually push data through the system. Of course, that meant I found many nasties that were hiding in the code, but at this point it is reliably giving me the right error messages when I push in broken values. There is still a lot of work to be done, but from now on I should be able to test things as I go, which should reduce that 'groping in the dark' feeling a bit.

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.
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 4 comments