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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: Using regex in file glob ?
by LanX (Saint) on May 03, 2021 at 18:37 UTC
    > 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

      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