[EMAIL PROTECTED] (Paul G. Weiss) wrote:
>Well if it is lexical shouldn't it suppress the warnings
>anyhow?  Remember that the 'use' is lexically inside the
>BEGIN block where I have the pragma.

Yeah, but the line producing the warning isn't, and that's what counts for
lexicals.

>Any in any case:
>
>BEGIN {
>    no warnings qw(deprecated);
>    local $^W=0;
>    use Apache::DBI ();
>}
>
>doesn't suppress the error.

That's kind of surprising.  Someone with 5.6 will probably have to sort this
out with you, or even better, patch Apache::DBI.  As I said earlier, the
warning is probably right - using defined on aggregates is seldom a good idea,
and that's been true and documented for a really long time.  See perlfunc(1):


               You may also use defined() to check whether a
               subroutine exists.  On the other hand, use of
               defined() upon aggregates (hashes and arrays) is
               not guaranteed to produce intuitive results, and
               should probably be avoided.
               
               ...

               Currently, using defined() on an entire array or
               hash reports whether memory for that aggregate has
               ever been allocated.  So an array you set to the
               empty list appears undefined initially, and one
               that once was full and that you then set to the
               empty list still appears defined.
               
               ...

               This counterintuitive behaviour of defined() on
               aggregates may be changed, fixed, or broken in a
               future release of Perl.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  [EMAIL PROTECTED]                            The Math Forum


Reply via email to