Another Perl Issue…

I have another issue to note about Perl. Before I note it I’d like to say that I’m really digging Perl. I’m seeing that Perl will replace a number of the shell scripts I’ve written and then do much more…. and it will do it easier and faster. (I had to say that so the Perl people know I’m not bashing them or their language).

That being said about easier and faster is true, but it won’t be/look “cleaner”. And if you don’t know Perl, don’t try to read the code. This leads me to my “beef”. Why are you not forced to use the return statement when returning values from sub-routines? That really bothers me. I understand that it’s quicker to just let the last value be the return value, but the possible “gotcha’s” that come from adding print stmts and the end of a sub-routine are huge. It could be a debugging nightmare.

It’s very similar to the rule/shortcut in Java that doesn’t require the use of curly-braces with single line if stmts. That always turns into a maintenance nightmare. Why, Why, Why is that legal? That is bad design and it’s bad in Perl. And no parens in subs in Perl is bad, and no return stmts in Perl is bad……

Sorry for all that. I promise to post some good things about Perl before I post another rant.

Leave a Reply

Your email address will not be published. Required fields are marked *