[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    RE: [perl #26632] report errors with more precision
From:       Rafael Garcia-Suarez <rgarciasuarez () free ! fr>
Date:       2004-03-30 13:44:55
Message-ID: 1080654295.406979d77a227 () imp6-q ! free ! fr
[Download RAW message or body]

Selon "Orton, Yves" <yves.orton@de.mci.com>:
> Would be better. Considering:
> 
>   D:\>perl -e "use strict; use warnings; sub f{undef}; print %{f()} "
>   Can't use an undefined value as a HASH reference at -e line 1.
> 
>   D:\>perl -e "use strict; use warnings; sub f{undef}; print @{f()} "
>   Can't use an undefined value as an ARRAY reference at -e line 1.
> 
>   D:\>perl -e "use strict; use warnings; sub f{undef}; print f()->() "
>   Use of uninitialized value in subroutine entry at -e line 1.
>   Can't use string ("") as a subroutine ref while "strict refs" in use at -e
> line 1.

This case is a bit special because perl tries to access a
subroutine by name; the other ones deal with autovivification.
Thus, the little difference in wording makes sense.

>   D:\>perl -e "use strict; use warnings; sub f{undef}; print ${f()} "
>   Can't use an undefined value as a SCALAR reference at -e line 1.
> 
>   D:\>perl -e "use strict; use warnings; sub f{undef}; print f()->{foo};"
>   Can't use an undefined value as a HASH reference at -e line 1.
> 
> Afaict these are all the same error, shouldn't they throw more or less the
> same error message? (wrt: sub routine version)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic