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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.