in reply to Regex Problems

a regexp that will strip everything but the extension (if that's what you're trying to do - you are a bit unclear) is:
use strict; my $filename="camel.flea"; $filename=~s/\w+(\.\w+)$/$1/; # Warning: untested
But for filename manipulations such as the ones you're doing, I would recommend File::Basename. No need to reinvent the wheel with the risk of inventing a square one...

CU
Robartes-