use strict; use warnings; use Cwd; my $dir = cwd; opendir (DIR, $dir) || die $!; my @files = readdir (DIR); closedir (DIR); { local ($\,$,) = ($/, $/); print @files; }