use Path::Tiny 0.028; my $dir = path ('/path/to/dir'); # Retrieve all entries except '.' and '..' my @all = $dir->children (); # Alternatively, retrieve a subset - here just the perl scripts my @perl = $dir->children (qr/\.pl$/);