On Mon, 23 Jul 2001, Tim Maher/CONSULTIX wrote:
> On Sun, Jul 22, 2001 at 10:07:22PM -0700, Peter Scott wrote:
> > At 12:14 PM 7/21/2001 -0700, you wrote:
> > > @A={ 'a', 'b' } ; # Warning: odd number of initializers!
>
> Sorry, you're quite right, I had intended a hash assignment
> > ??? I don't think the warning is that the number is odd but that the right
> > hand side contains only one item.
Maybe someone had an old version of Perl? The error message for this used
to be something like "odd number of elements in hash list", which (besides
confusing people) implies that there is such a thing as a hash list. Of
course, the real problem is that the poor user says, But I gave it an even
number of items!
So, some time back, we changed it to the newer warning which is more like
"Reference found where even-sized list expected." This, we hope, points
out that the hash reference is not a hash, and includes better explanatory
text in perldiag.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/