Blob


1 #!/usr/bin/perl
3 # Modify the program to include all files, not just the ones that
4 # don't begin with a dot.
6 use v5.24;
7 use warnings;
8 use strict;
9 use utf8;
10 use Cwd;
12 if (scalar(@ARGV) > 1) {
13 die "Usage: $0 [dir]";
14 }
15 my $dir = shift @ARGV;
16 if (!defined($dir) || $dir =~ /\A\s*\z/) {
17 chdir or die "Unable to change to $ENV{HOME}: $!";
18 } else {
19 chdir $dir or die "Unable to change to $dir: $!";
20 }
22 my @files = glob '.* *';
23 print join "\n", @files;
24 print "\n";