in reply to Hash ref and file extensions
my %ext; while (<>) { next unless /\S/; /(\.[^.]+)?$/; $ext{lc($1||"")}++; } printf "%-6s %d\n",$_||'<NONE>',$ext{$_} for sort keys %ext; [download]
Remove the lc() if you are on a case sensitive file system.