It occurs to me that if you don't know the extension in advance, this approach would be more flexible.
use strict; use warnings; use File::Basename; my $s = "/home/virtual/path/to/www/some/directory/filename.txt"; my ($base,$path,$ext) = fileparse($s,'\..*'); print "$base\n";
Scott
In reply to Re^2: Isolating a file name
by helphand
in thread Isolating a file name
by keiusui
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |