Hello,
with perl 5.8 with this script:
#!/usr/bin/perl
#hash2.pl
use warnings;
use strict;
my %where=(
London => "England",
Madrid => "Spain",
);
print "-"x20, "\n";
my ($a, $b) = each %where;
my ($c, $d) = each %where;
print "$a $b\n";
print "$c $d\n";
print "-"x20, "\n";
# my @ou = %where;
$where{Paris} = "France";
while (my ($x, $y) = each %where) {
print "$x => $y\n";
}
print "-"x20, "\n";
I get the output:
--------------------
London England
Madrid Spain
--------------------
--------------------
if I uncomment the line: # my @ou = %where;
I get: (What I expect)
--------------------
London England
Madrid Spain
--------------------
Paris => France
London => England
Madrid => Spain
--------------------
Can someone explain to me, why I have to add, my @ou = %where, to get what
I expect?
tia.
--
Gérard
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>