#!/usr/bin/perl use strict; use warnings; use File::Util; use 5.010; my $dir = 'example/path'; my $fu = File::Util->new(); my @files = $fu->list_dir($dir => {files_only => 1, files_match => qr/^(?!.*\.txt$)/i}); say for @files;