| hand waving here... my $fname = "20130101Customer100.imp"; # gotta go somewhere.. $fname =~ m@^(\d+)([A-Za-z0-9]+)\.imp$@; # Capture what we are looking for... my $dateStamp=$1; my $basename=$2; | do something with this.