On Wednesday 22 August 2001 13:06, Troy Denkinger wrote:
> If you mean assigning like this:
>
> %test = undef;
Replying to myself.... Okay, I spent more time looking at this. Here's what
I see:
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
%test = undef;
print Dumper( \%test );
%test = 1;
print Dumper( \%test );
Yields:
Odd number of elements in hash assignment at test.pl line 8.
Use of uninitialized value in list assignment at test.pl line 8.
$VAR1 = {
'' => undef
};
Odd number of elements in hash assignment at test.pl line 11.
$VAR1 = {
'1' => undef
};
Which make sense, I think because you're passing in a list of values to the
hash. Perl assigns the first element of the list to the first key and then,
since there's nothing for the first value makes it undef.
Try this to see what I mean:
%test = ( 1, 2, 3, 4 );
print Dumper( \%test );
Regards,
Troy
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]