http://www.perlmonks.org?node_id=274481

atnonis has asked for the wisdom of the Perl Monks concerning the following question:

hello monks!
i have a problem parsing a hash into a sub
new_packages($fcount,%new_db); sub new_packages { my %packages = $_[1]; print "Found $_[0] packages for download: $_\n" if ($fcount > 1); print "Found $_[0] package for download: $_\n" if ($fcount == 1); print "Which one would you like to install?:\n"; foreach my $key (keys (%packages)) { print "$key) $packages{$key} \n" } }
i get the following error:
Odd number of elements in hash assignment at ./slackup.pl line 49. Use of uninitialized value in concatenation (.) or string at ./slackup +.pl line 50. Found 3 packages for download: Which one would you like to install?: Use of uninitialized value in concatenation (.) or string at ./slackup +.pl line 54. 1)
the hash has these values:
%new_db = (1 => 'gedit-2.2.2-i386-1.tgz', 2 => 'ppp-3.4.1-i386-2.tgz')
where is my mistake i cant figure out!?

atnonis!