NevadaJones
Programmer
- Sep 5, 2006
- 26
How can I remove extra periods from a file name? There could be two or more periods in a file that someone uploads and I want to keep only the last one before the file extention. What I have removes all periods, but I want to check to see if there are more than one and then only keep the last one.
my $filename = "file.soe.that.this.whatever.ext";
$filename =~ s/\.//;
print $filename;