in reply to Regex pattern to find directories only with digits

In case you need to search recursively, you may use the File::Find core module:

use strict; use warnings; use File::Find; # Search current dir unless dir(s) given as command line args @ARGV = qw(.) unless @ARGV; find( \&get_dirs_with_numbers, @ARGV ); sub get_dirs_with_numbers { return unless /^\d+$/; # your regex print $File::Find::name . "\n"; }

find function from File::Find scans directories in @ARGV recursively and for each file calls the referenced function (coderef) get_dirs_with_numbers. Before calling your function find by default changes to the directory being scanned and sets the following variables:

Well done is better than well said. -- Benjamin Franklin