There is no need for the second my. The variable has already been declared. When you redeclare the variable it is undefined so your substitution is meaningless. Once you fix that, your substitution is wrong also. It attempts to replace the whole filename with the extension because that's the part you are capturing in $1. Try this as your second line:
$filename2 =~ s/\.[^.]*$//;-sauoq "My two cents aren't worth a dime.";
In reply to Re: Regex Problems
by sauoq
in thread Regex Problems
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |