http://qs321.pair.com?node_id=1226951


in reply to What's your programming style?

None of the above.

1) Too many comments. Good names remove the need for most/all of them.

2) What's with all this CamelCase naming? Normal Perl practice is underscore_joined_names.

3) Why are you doing this yourself instead of using one of the many fine CPAN modules that handle it?

4) If you must roll your own, a regex match is much Perlier than index and, therefore, more likely to be instantly understood by someone looking at the code. I question whether the average Perl beginner would even understand your "The Beginner" version unless they're already familiar with index from past experience with other languages. (Also, the use of postfix conditionals (return if rather than  if () { return }) is rather idiosyncratic to Perl and often treated as either "advanced" or "to be avoided", rather than a "beginner" technique. I disagree with that view, but it seems to be relatively common nonetheless.)