Imho glob()bing is ugly anyway. You don't need it. It is much better (again imho) to use grep and readdir, which is also much more portable:
my $dir = shift; my @list = grep /\.java$/ => sub { opendir my $dh => $_[0] or return; my @l = readdir $dh; closedir $dh; return @l }->( $dir ) ;
The subref is of course overhead, but you might want to keep it as named sub for multiple use.
--In reply to Re: globing directory names with spaces
by fruiture
in thread globing directory names with spaces
by abhishes
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |