Xfiles has asked for the wisdom of the Perl Monks concerning the following question:
but it gives me the following error :#!usr/bin/perl use strict ; use warnings ; my %hash = {'perl' => 1 , 'C' => 0} ; foreach my $key(sort keys %hash) { print "$key : $hash{$key} \n" ; }
so what is exactly the problem ?Reference found where even-sized list expected at perl.pl line 9. Use of uninitialized value $hash{"HASH(0x98bf7ec)"} in concatenation ( +.) or string at perl.pl line 12. HASH(0x98bf7ec) :
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing hash produce errors
by bart (Canon) on Jun 02, 2013 at 12:18 UTC | |
by Xfiles (Initiate) on Jun 02, 2013 at 12:22 UTC |