develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [PATCH 5.6.0-RC1] more warnings tidy ups

March 15, 2000 05:06
Re: [PATCH 5.6.0-RC1] more warnings tidy ups
Message ID:
In <>, writes:
:From: Hugo []

That'd be

:> In <>,
:> paul. writes:
:> :
:> :  * h2xs.PL now includes a "use warning" in the .pm file it creates.
:> Can you explain what the benefit of this is?
:For the same reason we put a "use strict" at the top of the .pm file that
:h2xs generates. We are trying to encourage good coding practice. 

Isn't this somewhat equivalent to the '-w on by default' scenario?
I'm not necessarily against it, but I'm not sure how far we want to
push users to take this up.

:> Independently of that, is there any reason not to replace the 'use Carp'
:> in with a require() in sub warn {}?
:None than I can think of. Does it make much of a difference?

It saves pulling in Carp and Exporter unnecessarily: not relevant for
h2xs, which tends to drag them in anyway, but may save resources in
other situations. The cost is an extra 'have I loaded this yet' check
in the second and subsequent calls to warnings::warn, which I assume
would rarely be significant.

Hugo Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About