/usr/share/doc/libfile-util-perl/examples/list_the_contents_of_a_directory.pl is in libfile-util-perl 4.161950-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # ABSTRACT: List the contents of a directory
use strict;
use warnings;
use File::Util qw( NL );
my $ftl = File::Util->new();
my $dir = '/tmp'; # in this example, this file must already exist
# option --no-fsdots excludes "." and ".." from the list
my @dirs_and_files = $f->list_dir( $dir, '--no-fsdots' );
# The NL constant below will be the apropriate newline character sequence
# for your operating system... "\n" or "\r\n"
# print out the list of files, each on its own line
print join NL, @dirs_and_files;
exit;
|