I'm simply trying to get a list of filenames given a path with wildcard.

my $path = "/foo/bar/*/*.txt";
my @file_list = glob($path);
foreach $current_file (@file_list) {
   print "\n- $current_file";
}

Mostly this works perfectly, but if there's a file greater than 2GB, somewhere in one of the /foo/bar/* subpaths, the glob returns an empty array without any error or warning.

If I remove the file file or add a character/bracket sequence like this:

my $path = "/foo/bar/*[0-9]/*.txt";

or

my $path = "/foo/bar/*1/*.txt";

then the glob works again.

UPDATE:

Here's an example (for a matter of business policy I had to mask the pathname):

[root]/foo/bar # ls -lrt
drwxr-xr-x    2 root     system         256 Oct 11 2006  lost+found
drwxr-xr-x    2 root     system         256 Dec 27 2007  abc***
drwxr-xr-x    2 root     system         256 Nov 12 15:32 cde***
-rw-r--r--    1 root     system  2734193149 Nov 15 05:07 archive1.tar.gz
-rw-r--r--    1 root     system     6913743 Nov 16 05:05 archive2.tar.gz
drwxr-xr-x    2 root     system         256 Nov 16 10:00 fgh***
[root]/foo/bar # /home/user/test.pl
[root]/foo/bar #

Removing the >2GB file (or globbing with "/foo/bar/[acf]/" istead of "/foo/bar//")

[root]/foo/bar # ls -lrt
drwxr-xr-x    2 root     system         256 Oct 11 2006  lost+found
drwxr-xr-x    2 root     system         256 Dec 27 2007  abc***
drwxr-xr-x    2 root     system         256 Nov 12 15:32 cde***
-rw-r--r--    1 root     system     6913743 Nov 16 05:05 archive2.tar.gz
drwxr-xr-x    2 root     system         256 Nov 16 10:00 fgh***

[root]/foo/bar # /home/user/test.pl
- /foo/bar/abc***/heapdump.phd.gz
- /foo/bar/cde***/javacore.txt.gz
- /foo/bar/fgh***/s
Edit
Report