![]() ![]() The built-in module for traversing a directory tree in Perl is File::Find, but it has some severe limitations in interface and use. ![]() IO-All - a no longer recommended all-in-one IO package with a lot of syntactic sugar, but quite a few quirks and bugs.File::Copy - a core module to copy files.File::Path - a core module to create or remove directory trees (portably).String-ShellQuote - quote strings for passing through the shell.File::Basename - a core module to portably extract the basename, the dirname, the suffix and other file paths parsing.File::Spec - a core module to handle file and directory paths portably.( Note: Using File-Slurp, and File-Slurp-Tiny which were found to be broken, is no longer recommended.) The interface is procedural and quite Spartan, but is still useful. File-Slurper - a module for fast and easy input and output from files and directories.Path-Tiny - a module that provides a âfast utility for working with file pathsâ and which despite its name, provides a comprehensive and rich API.Useful modules for files and directories handling are: There are also many UNIX-oriented file-system-builtins listed on perlfunc which may prove of utility. Get an array of lines in a file with trailing newlines removedįor the basics, read about the open function (on perlopentut or on recommended books or tutorials) as well as other built-ins such as opendir, readdir, closedir, mkdir.Reading an entire UTF-8 file into a big variable.Many modules on CPAN (= the Comprehensive Perl Archive Network) aim to facilitate the task even further. Perl has strong support for handling files and directories, which are the bread-and-butter of dealing with the disk and the filesystem. Learn Perl Now! And get a job doing Perl. CPAN Wrappers for Creating System PackagesĬontent Files and Directories Handling in Perl.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |