I always prefer regexes, but have to admit that choroba's proposal is much cleaner.
use strict; use warnings; my $filename = "p_abc_xyz_123.txt"; print "$1$2$3\n" while( $filename =~ s/(.*)(_\w{3})(\..*)/$1$3/ );
In reply to Re: Files in a directory
by hdb
in thread Files in a directory
by amma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |