#!/usr/bin/env perl
use strict;
use warnings;
my $dirname = shift; # first command-line argument.
opendir(DIR, $dirname) or die "can't open $dirname: $!
";
@files = readdir(DIR);
closedir(DIR);
foreach my $file (@files) {
print "$file
";
}