develooper Front page | perl.perl5.porters | Postings from January 2015

[perl #123691] Feature: A variation of glob() which uses regexps

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
January 29, 2015 11:51
Subject:
[perl #123691] Feature: A variation of glob() which uses regexps
Message ID:
rt-4.0.18-19448-1422532298-1172.123691-15-0@perl.org
On Wed Jan 28 10:39:13 2015, porton@narod.ru wrote:
> 
> This is a bug report for perl from porton@narod.ru,
> generated with the help of perlbug 1.40 running under perl 5.20.1.
> 
> 
> -----------------------------------------------------------------
> I suggest to add to Perl core a routine similar to glob(), but
> using regexps instead of globs.
> 
> 

But that functionality already exists, does it not?

(untested)
#####
opendir my $DIR, 'some/directory' or die;
my @files = grep { m/some_pattern/ } readdir $DIR;
closedir or die;
#####



-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=123691

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About