Hi all I realy don't understand why I dont get "Global symbol "%CS101" requires explicit" when I run:
#!/usr/bin/perl # use warnings; use strict; use Carp; use 5.016; ave(); my %CS101 =("Joe Below" => 100, "Dan Gold" => 90, "Jon Kery" => 40, "Elton Jon" => 60, ); sub ave { foreach (keys %CS101) { print $CS101{$_}, "\n"; } } 1; __END__
It only wotks if I put the hash at the top. Thanks in advance. Adrian
In reply to subroutine no error by adriang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |