http://qs321.pair.com?node_id=805630


in reply to What's wrong with this grep?

And then there's File::Find::Rule
use File::Find::Rule qw( ); my @files = File::Find::Rule ->name( qr/^\d{8}\.\d{6}\.host\d\.\d{1,6}$/ ) ->file() ->maxdepth(1) ->in( $path );

The advantage is that you get qualified file names.

It's cheaper to execute a regex match than to check if a file is a plain file, so I reversed the order of the tests.