Exercise
See Appendix A for answers to the following exercise:
[15] Install the
Module::CoreListmodule from CPAN. Print a list of all of the modules that came with Perl 5.006. To build a hash whose keys are the names of the modules that came with a given version of Perl, use this line:my %modules = %{ $Module::CoreList::version{5.006} };[15] Get a list of filenames in the current directory. Use the
C<Cwd>module to get the current directory, then use theC<File::Spec>module to join the directory name with the filenames to get an absolute path. Print the list of paths to standard outout with one path per line. Your solution should be portable to other operating systems.[15] Using the output from the previous exercise, read in a list of paths and use the
C<File::Basename>module to extract the filename from each path. Print each name on a line by itself. Your solution should be portable to other operating systems.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access