Blob


1 #!/usr/bin/perl
3 # Write a program that changes to some particular (hardcoded)
4 # directory, like the system's root directory, then executes the ls
5 # -l command to get a long-format directory listing in that
6 # directory. (If you use a non-Unix system, use your own system's
7 # command to get a detailed directory listing.)
9 use v5.24;
10 use warnings;
11 use strict;
12 use utf8;
14 chdir '/' or die "Unable to chdir to '/': $!";
15 exec 'ls', '-l' or die "Unable to run 'ls -l': $!";