sub extension { my $path = shift; my $ext = (fileparse($path,'\.[^.]*'))[2]; $ext =~ s/^\.//; return $ext; }