in reply to Re^2: Using regex in file glob ?
in thread Using regex in file glob ?

> I think

you? think? :)

update

@OP

I just noticed that https://perldoc.perl.org/functions/readdir has examples for exactly what I suggested: grepping files by regex.

And here a minimal example of mine to find all .pl files in the current dir (win flavor)

>perl -E"opendir my $dh, '.'; say join qq{\n}, grep{/\.pl$/} readdir($ +dh)" demo_lock_data.pl print_time.pl self_rename.pl uniq_time.pl wrapped_pl.pl

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^4: Using regex in file glob ?
by jdporter (Paladin) on May 03, 2021 at 21:19 UTC
    perl -lE"opendir$d,'.';say for grep/\.pl$/,readdir$d"
      > perl -E"say for grep{/\.pl$/} <*>" demo_lock_data.pl print_time.pl self_rename.pl uniq_time.pl wrapped_pl.pl

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery