EC Lab 6 due Saturday May 14th, 2011 at 12:01 am This lab is worth 5 points, which are not part of the 100 that is available through other labs. These points are only extra credit. No modules other than strict should be used for this lab- this is an exercise in Perl's basic directory and file manipulation commands, and in a little creative recursive programming, if you so desire... Your lab will accept one parameter at the command line, which is a directory. If it isn't a directory, you should print an error message. You should open the directory with opendir, read items with readdir, and close when you are done. The only file types that I want to see are ones that agree with the -d or -f file tests, so no links, named pipes, etc- only regular files (-f) and directories (-d). For each directory, ignore the files called "." and ".." as discussed in class. Again, also ignore anything which is not a regular file or a directory. And now, for the specific items... 1. Print out the contents of each directory, including the owner, gid, and file size of each file that passes the conditions mentioned above, and the name of each directory. Sort all the files to the top, with all the subdirectories of the given directory listed at the bottom. 2. For each thing that is a directory, ALSO apply rule #1 to it, printing the details inline with the rest. A sample output: ./lab6.pl some_dir Dir: some_dir joseph:staff foo joseph:staff 27 bar joseph:staff 48 Dir: baz joseph:staff fire joseph:staff 35 blood joseph:staff 57 Dir: death joseph:staff mud joseph:staff 10233 Dir: some_other joseph:staff some_file joseph:staff 23 This output would be for a directory named "some_dir" given at the command line. This directory contains the files "foo" and "bar", as well as the directories "baz" and "some_other". baz contains the files "fire" and "blood", and the directory "death", which contains the file "mud". The directory "some_other" contains "some_file". In this example, all of the files and directories were owned by joseph and had a group of staff, with the file sizes represented by the numbers above.