Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Using regex in file glob ?

by Anonymous Monk
on May 03, 2021 at 16:39 UTC ( [id://11131982]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11131982]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-24 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found