use IO::Dir; my $d = IO::Dir->new('.') or die $!; print "$_\n" for $d->read;