in reply to Re: next if regex matches
in thread next if regex matches

Zaxo,
Exactly what I was thinking - unless there is something the OP isn't telling us, there is no need to even do the work.
#!/usr/bin/perl -w use strict; while (glob("*.txt *.log")) { print "$_\n"; }
Where you only get .txt and .log files, although I would have used <*.txt *.log>.

Cheers - L~R