most of you probably have encountered foreign code of questionable quality. While this can be kind of frustrating if one finds himself in the situation of a maintainer, it can be (should be) fun without those bad feelings if one just may sight such code and float by.
This is a call for a fashion parade...
...of such code snippets that will remain unforgettable to you. I'll make a start with some of those I encountered:
Example 1: cut first and last char of string
Example 2: ensure string isn't longer than 50 charschop $str; reverse $str; chop $str; reverse $str;
Make your contribution. Let's have a laugh together. Perhaps we even make it to sum up enough material for a anti-cookbook ;-)chop $default_title while (length $default_title > 50);
Bye
PetaMem All Perl: MT, NLP, NLU
In reply to Pearls (not really) of Perl programming by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |