monaco-editor/website/index/samples/sample.perl.txt
2021-11-16 22:32:27 +01:00

18 lines
No EOL
328 B
Text

#!/usr/bin/perl
use strict;
use warnings;
use Path::Tiny;
my $dir = path('foo','bar'); # foo/bar
# Iterate over the content of foo/bar
my $iter = $dir->iterator;
while (my $file = $iter->()) {
# See if it is a directory and skip
next if $file->is_dir();
# Print out the file name and path
print "$file\n";
}