Here's my problem (well, a shortened example=)

#hashes.pl
use strict;
use warnings;

use Data::Dumper;

my %a=(a=>1, b=>2, c=>3);
print Dumper \%a;

print "\n".("-" x 10)."\n";

my $c=$a{d}->[0]; 

print Dumper \%a;

$ perl hashes.pl

 
$VAR1 = {
          'c' => 3,
          'a' => 1,
          'b' => 2
        };

----------
$VAR1 = {
          'c' => 3,
          'a' => 1,
          'b' => 2,
          'd' => []
        };


Now, while I'd expect a warning on the line of my $c=$a{d}->[0]; (like,
dunno, you're trying to dereference undef?) I'd never think a field is
added to the hash...

I'm confused.. Is this expected behaviour? Changing a right-hand operand
(without calling a sub)?

cheers
paolino

-- 
Paolo Gianrossi
Softeco Sismat S.p.A. - R&D Division
via De Marini 1, 16149 Genova
Tel: +39 010 6026 332 - Fax: +39 010 6026 350
E-Mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to