27 lines
471 B
Perl
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;
|