[32240] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3505 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 24 09:09:29 2011

Date: Sat, 24 Sep 2011 06:09:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 24 Sep 2011     Volume: 11 Number: 3505

Today's topics:
    Re: 'use warnings' vs the -w flag <cwilbur@chromatico.net>
    Re: 'use warnings' vs the -w flag <rweikusat@mssgmbh.com>
    Re: 'use warnings' vs the -w flag <nospam-abuse@ilyaz.org>
    Re: 'use warnings' vs the -w flag <nospam-abuse@ilyaz.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 23 Sep 2011 10:47:38 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: 'use warnings' vs the -w flag
Message-Id: <87ipojfh85.fsf@new.chromatico.net>

>>>>> "HL" == Henry Law <news@lawshouse.org> writes:

    HL> perldoc warnings and perldoc perllexwarn seem to me to make the
    HL> case quite comprehensively for "use warnings" rather than -w, on
    HL> the grounds of flexibility if nothing else; but Ilya says that
    HL> at least some of this is plain wrong.  What's a coder to do?

Decide whether you prefer an argument based on evidence, as set forth in
perldoc warnings and perldoc perllexwarn, or an argument based on
authority, as set forth by "Ilya says so."

("Ilya says some of this is wrong" is not evidence.  He could provide
evidence, but he has not done so.)

Charlton



-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Fri, 23 Sep 2011 16:59:03 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: 'use warnings' vs the -w flag
Message-Id: <87wrczs114.fsf@sapphire.mobileactivedefense.com>

Charlton Wilbur <cwilbur@chromatico.net> writes:

>>>>>> "HL" == Henry Law <news@lawshouse.org> writes:
>     HL> perldoc warnings and perldoc perllexwarn seem to me to make the
>     HL> case quite comprehensively for "use warnings" rather than -w, on
>     HL> the grounds of flexibility if nothing else; but Ilya says that
>     HL> at least some of this is plain wrong.  What's a coder to do?
>
> Decide whether you prefer an argument based on evidence, as set forth in
> perldoc warnings and perldoc perllexwarn, or an argument based on
> authority, as set forth by "Ilya says so."

The difference is that -w/-W enable warnings for all code processed by
perl while 'use warnings' only enables warnings for its lexical scope.
It should be noted that the perllexwarn text asserts that the
behaviour of -w was 'a big problem' but doesn't provide a reason for
that. A counterargument which comes immediately to mind would be:
Ultimatively, I'm responsible for getting the specific combination of
third-party code and newly developed code that is being used to
work. This implies that I may need to debug and change the third-party
developed code and consequently, I want to see warnings triggered by
it, no matter what somebody who happened to work on it at some time in
the past thought about that. I can always ignore them if I'm convinced
that they are harmless.




------------------------------

Date: Fri, 23 Sep 2011 19:46:40 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: 'use warnings' vs the -w flag
Message-Id: <slrnj7pogv.c0m.nospam-abuse@panda.math.berkeley.edu>

On 2011-09-23, Rainer Weikusat <rweikusat@mssgmbh.com> wrote:
> The difference is that -w/-W enable warnings for all code processed by
> perl while 'use warnings' only enables warnings for its lexical scope.

Exactly.

> Ultimatively, I'm responsible for getting the specific combination of
> third-party code and newly developed code that is being used to
> work. This implies that I may need to debug and change the third-party
> developed code and consequently, I want to see warnings triggered by
> it, no matter what somebody who happened to work on it at some time in
> the past thought about that.

This is all very true - but it is only a tip of the iceberg of the -w
vs warnings debate.

The MOST important reason why `use warnings' is IMO absolutely useless
is that it does not catch MY bugs if they are detected only when
processing is "moved" into another package.

  perl -le "{use warnings; p($c) unless $c} sub p {print shift}"

Given -w, this WOULD give a warning.

> I can always ignore them if I'm convinced that they are harmless.

I ALWAYS use -w.  Nowadays, it is practically never when I need to put
workarounds for somebody's sloppy code.

Hope this helps,
Ilya


------------------------------

Date: Fri, 23 Sep 2011 20:07:42 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: 'use warnings' vs the -w flag
Message-Id: <slrnj7ppoe.dsk.nospam-abuse@panda.math.berkeley.edu>

On 2011-09-23, Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> The MOST important reason why `use warnings' is IMO absolutely useless
> is that
 ...

Oups, the thread changed!  This "absolutely useless" WAS qualified in
the other thread, but not here.  So please read it as

  absolutely useless (in context of writing scripts)

When one writes packages, $^W and -w are not so easily available, so
`use warnings' is a great palliative.

Ilya


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3505
***************************************


home help back first fref pref prev next nref lref last post