Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    while (($key, $value) = each(%fred)) {
    print "key = $key value = $value\n" ;
    }
    
  2. or download this
    chomp(@words = <STDIN>);
    # read the words, minus newlines
    ...
    foreach $word (keys %count) {
    print "$word was seen $count{$word} times\n";
    }