in reply to regex to return file extensions
im use this and work very fine:
my ($filename,$extension) =~ m/(.*)\.(.*)/;
if the filename is fjgdkfjkgs........................gif, well it regex return fjgdkfjkgs....................... to the filename and gif to extensions.
Success