use warnings; use strict; my $folder = "/usr/fldr wth spaces"; print "====== core glob ======\n"; while (glob "$folder/*.txt") { print "$_\n"; } print "Press "; <>; { use File::Glob ':glob'; print "======with File::Glob ':glob'======\n"; while (glob "$folder/*.txt") { print "$_\n"; } print "Press "; <>; }