You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
471 B
Perl

#!/bin/perl
use AnyDBM_File;
dbmopen(%states, "statedb", 0666);
@sortedkeys=sort keys %states;
foreach $key ( @sortedkeys ){
$value=$states{$key};
$total++;
write;
}
dbmclose(%states);
format STDOUT_TOP=
Abbreviation State
------------------------------
.
format STDOUT=
@<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<
$key, $value
.
format SUMMARY=
------------------------------
Number of states:@###
$total
.
$~=SUMMARY;
write;