#! /usr/bin/env perl use Cwd qw( realpath ); use File::Spec::Functions; my $dirToWalk = realpath($ARGV[0] || '.'); ##print "Processing directory '$dirToWalk'\n"; print < EOT opendir(my $dH, $dirToWalk) || die("Failed to open directory\n$!"); while (my $f = readdir($dH)) { next if $f =~ /^\.|~$/; $f = catfile($dirToWalk, $f); print " $f\n"; } closedir($dH); print "\n";