I want only .txt should display not A1.txt, how can i exclude the that
* is a quantifier in regex, you probably did not mean to use it there.
This might do: if ( $file =~ m/^CHECK.*\.txt$/ and $file !~ m/A1\.txt$/ ) { ...
!~ to negate the "A1.txt" part.
Cheers, Sören
(hooked on the Perl Programming language)
In reply to Re: how to check whether a particular word exists in filename
by Happy-the-monk
in thread how to check whether a particular word exists in filename
by learner@perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |