I am trying to create a hash and then print it out. When executing program, I am getting $key & $value need explicit package. O wise monks, please show me the error of my ways :)
#! /usr/bin/perl use v5.12; use warnings; ## 2/15/19 my @people = qw{ fred barney fred wlima dino barney fred pebbles +}; my %count; # new empty hash $count{$_}++ foreach @people; while ( ($key, $value) = each %count) { print "$key => $value\n"; } ~
TIA the catfish
In reply to Print out hash by catfish1116
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |