in reply to Re^3: Coding styles: OOP vs. Subs
in thread Coding styles: OOP vs. Subs

Here's a one-liner where Perl emits two warnings - both wrong.
$ perl -le 'use warnings; print ("$_") for qw /foo, #bar/' print (...) interpreted as function at -e line 1. Possible attempt to separate words with commas at -e line 1.
And yes, I know what the warnings are for. And I know how to code around them. The warnings are still wrong though.
Perl --((8:>*

Replies are listed 'Best First'.
Re^5: Coding styles: OOP vs. Subs
by Anonymous Monk on Nov 17, 2005 at 17:17 UTC
    That still seems like bad form to me. Imagine someone comes along and tries to extend it...
    use warnings; print ("$_")."blah" for qw /foo, #bar, BAZ/
    Just because you can do something doesn't mean you should. (Not that I'm implying that you should never turn off warnings. The OP's code isn't one of those times though).
      Huh? What's your point? Valid code throwing warnings prevents someone from introducing bugs?
      Perl --((8:>*
        The point is, seeing code like that lets a maintenance programmer know that the original coder isn't that familiar with Perl, and to tread with caution, because there are undoubtedly obscure bugs lurking around.