Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • open(NAMES, "<", "/var/census/names.txt") or die "Do the census first!";
    while ($people{<NAMES>}++) {};
    close NAMES;
    $sum = 0;
    foreach $name (sort keys %people) {
      $n = $people{$name};
      $sum += $n;
      printf "%6d $name", $people{$name};
    }
    print "=" x 72, "\n";
    print "Total: $sum\n";
    --
    -- I know Perl has many uses, but I use it mostly for programming.