Managing and Navigating Directories

Just as you can work with files inside Perl as you might in a shell or command line, you can also navigate around your file system and manage directories (or folders, depending on your OS loyalties). You can find out the current directory, change the current directory, list the contents of that directory or some subset of its files, and create or remove the directories themselves. This section explains some of the nuances of performing these operations with Perl.

Navigating Directories

Each Perl script has a notion of a current working directory, that is, the directory from which the script was called (if you're used to working with command line–based systems, this is no surprise to you).To change the current ...

Get Sams Teach Yourself Perl in 21 Days, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.