http://qs1969.pair.com?node_id=516401
Category: Miscellaneous
Author/Contact Info Marco Lima <mago at rio.pm.org>
Description: Counting the Extensions of the Archives in Current Directory.
#!/usr/bin/perl -w
use strict;

my %extensions;

while (<*>) {
    if (-f && /\.(\W+)$/) {
        $extensions{$1}++;
    }
}

foreach $key (keys %extensions) {
    print "$key -> $extensions{$key}";
}

__END__

LINE:

perl -e 'while(<*>){if(-f && /\.(\W+)$/){$e{$1}++}}print "$_ -> $e{$_}
+\n" for keys %e'