in reply to Re: gawk to perl
in thread gawk to perl

The article suggests:

If your gawk program doesn't make calls to other cygwin/unix utilities then it would probably be better to just distribute a Windows gawk executable to your colleagues along with the program.

But my problem is different - gawk is extremely buggy, often fails with INTERNAL ERROR and different versions of gawk behave differently. The last drop was that gawk was unable to make console output in proper codepage in Windows 7, so I decided to get rid of gawk completely.

Replies are listed 'Best First'.
Re^3: gawk to perl
by Corion (Patriarch) on Apr 09, 2010 at 07:36 UTC

    So, maybe, instead of trying to rely on buggy translators, consider simply rewriting the awk script in Perl?

    If you have a problem with a specific awk construct, maybe we can help you there. Alternatively, you'll have to explain what the awk snippet does and then find out how to accomplish the same using Perl.

Re^3: gawk to perl
by cdarke (Prior) on Apr 09, 2010 at 10:01 UTC
    different versions of gawk behave differently

    I think you found the reason why it is difficult to write a gawk to perl converter.

    My best suggestion is to use a2p and then hand-code Perl where you get the errors. To be honest converted code is rarely readable and often inefficient so Corion's suggestion might be better in the long term.