in reply to Re: Hash ref and file extensions
in thread Hash ref and file extensions

One small nit. I would replace this code:
if ($dot > -1) { $extension = substr($filename, $dot+1); $extensions{$extension}++; } else { $extensions{'_without_extension'}++; }
by:
$extensions{$dot == -1 ? '' : substr( $filename,$dot )}++;
for two reasons:
  1. it's more compact
  2. it allows you to differentiate between filenames without extension (no . found) and with an empty extension (a . at the end).
Liz