in reply to Converting pascal code to perl

IMHO, you guys are not taking a good approach to "convince his friend to use Perl". Point is that you try to 'golf' a pretty simple function, which causes it to lose readability, and that is very bad when maintenance is needed.

Surely, things can be made shorter in Perl than in Pascal, but shorter in places when Perl really has an advantage, like regexes, list processing and hashes (and many more, of course). I'm in no doubt that a Golf guru can knock the friend's whole 8-page program into a 512 byte block, but that is hardly the point.

On the contrary, you should show the friend how Perl can make things more clear and natural, and win where complex operations (which need to be implemented in Pascal) are used.

Good luck and happy Perl-ing

Replies are listed 'Best First'.
Re: Re: Converting pascal code to perl
by Popcorn Dave (Abbot) on Aug 15, 2002 at 16:18 UTC
    Actually that's my fault for not describing the whole problem in my original post.

    The original program takes data from web pages and parses the data to do a simluation on baseball players for a fantasy baseball league. My thought was, after looking at his pascal code and the hoops he had to jump through to do the parsing, that we could both combine the culling of the information and the process of the simulation in to one program.

    My thought was that with the text parsing capabilities Perl has, it was hands down the obvious language choice for this exercise. Of course he went ahead and did his in pascal anyway as he doesn't as of yet know Perl, so I thought I would convert it ( and him ) and see how much easier I could do it and sharpen my chops in the process.

    Some people fall from grace. I prefer a running start...