programming-examples/perl/File/Using chdir to change the current directory.pl

11 lines
150 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
chdir '..';
opendir(DIRECTORY, '.')
or die "Can't open directory.";
print join (', ', readdir(DIRECTORY));
closedir DIRECTORY;