Its should be ,

print $ky, ":" , $myhash{$ky}, "\n";

Shobha Deepthi V
The statement below is true.
The statement above is false.






Gergely Buday wrote:

Hi there,
do you have a clue why is this not working? The interpreter complains
about a syntax error in line 7 near $myhash.

#!/usr/bin/perl

%myhash = { "alma" => "apple", "korte" => "pear" };

foreach $ky (keys (%myhash))
{
       print $ky, ":" , $myhash($ky), "\n";
}

Reply via email to