sub extension { my $path = shift; my $ext = (split /\./, $path)[-1]; return $ext; }