Those purists probably don't really understand what structured programming is really about and want to make it a bureaucratic straight jacket.
I remember that one of my CS professors once chastised me for having written a function or procedure (I can't remember which language it was, most probably either C or Pascal) in which I was returning early out of the function if a certain condition was met (or not met, whatever), saying me that this was a form of hidden goto (he had introduced Dijkstra's famous "Goto considered harmful" piece just a week or two before). I still received a fairly good mark, but I really felt at the time it was a ridiculous point.
I was quite happy, years later, to read somewhere in the Camel Book that programming is often building a decision tree and that it makes sense to discard early special cases, rather than having a deeply nested if/then/elsif/else conditional. Quite often, using next or last can also improve significantly the performance and the readability.
I would strongly suspect that Perl is not the right language for such purists. Let them write ten times more code-lines with A*a or Ja*a. (OK, sorry, I don't want to introduce a language flame war, but I replaced yesterday a 1500++ lines shell script with less than 20 lines Perl script, and it works better).
In reply to Re^2: regex 1st match only
by Laurent_R
in thread regex 1st match only
by ArifS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |