File::Slurp 9999.12
Sponsored Links
File::Slurp 9999.12 Ranking & Summary
File size:
0.026 MB
Platform:
Any Platform
License:
GPL (GNU General Public License)
Price:
Downloads:
910
Date added:
2007-04-30
Publisher:
Uri Guttman
File::Slurp 9999.12 description
File::Slurp is a Perl module for efficient reading/writing of complete files.
SYNOPSIS
use File::Slurp;
my $text = read_file( filename ) ;
my @lines = read_file( filename ) ;
write_file( filename, @lines ) ;
use File::Slurp qw( slurp ) ;
my $text = slurp( filename ) ;
This module provides subs that allow you to read or write entire files with one simple call. They are designed to be simple to use, have flexible ways to pass in or get the file contents and to be very efficient. There is also a sub to read in all the files in a directory other than . and ..
These slurp/spew subs work for files, pipes and sockets, and stdio, pseudo-files, and DATA.
read_file
This sub reads in an entire file and returns its contents to the caller. In list context it will return a list of lines (using the current value of $/ as the separator including support for paragraph mode when it is set to ). In scalar context it returns the entire file as a single scalar.
my $text = read_file( filename ) ;
my @lines = read_file( filename ) ;
The first argument to read_file is the filename and the rest of the arguments are key/value pairs which are optional and which modify the behavior of the call. Other than binmode the options all control how the slurped file is returned to the caller.
If the first argument is a file handle reference or I/O object (if ref is true), then that handle is slurped in. This mode is supported so you slurp handles such as DATA, STDIN. See the test handle.t for an example that does open( -| ) and child process spews data to the parant which slurps it in. All of the options that control how the data is returned to the caller still work in this case.
NOTE: as of version 9999.06, read_file works correctly on the DATA handle. It used to need a sysseek workaround but that is now handled when needed by the module itself.
You can optionally request that slurp() is exported to your code. This is an alias for read_file and is meant to be forward compatible with Perl 6 (which will have slurp() built-in).
SYNOPSIS
use File::Slurp;
my $text = read_file( filename ) ;
my @lines = read_file( filename ) ;
write_file( filename, @lines ) ;
use File::Slurp qw( slurp ) ;
my $text = slurp( filename ) ;
This module provides subs that allow you to read or write entire files with one simple call. They are designed to be simple to use, have flexible ways to pass in or get the file contents and to be very efficient. There is also a sub to read in all the files in a directory other than . and ..
These slurp/spew subs work for files, pipes and sockets, and stdio, pseudo-files, and DATA.
read_file
This sub reads in an entire file and returns its contents to the caller. In list context it will return a list of lines (using the current value of $/ as the separator including support for paragraph mode when it is set to ). In scalar context it returns the entire file as a single scalar.
my $text = read_file( filename ) ;
my @lines = read_file( filename ) ;
The first argument to read_file is the filename and the rest of the arguments are key/value pairs which are optional and which modify the behavior of the call. Other than binmode the options all control how the slurped file is returned to the caller.
If the first argument is a file handle reference or I/O object (if ref is true), then that handle is slurped in. This mode is supported so you slurp handles such as DATA, STDIN. See the test handle.t for an example that does open( -| ) and child process spews data to the parant which slurps it in. All of the options that control how the data is returned to the caller still work in this case.
NOTE: as of version 9999.06, read_file works correctly on the DATA handle. It used to need a sysseek workaround but that is now handled when needed by the module itself.
You can optionally request that slurp() is exported to your code. This is an alias for read_file and is meant to be forward compatible with Perl 6 (which will have slurp() built-in).
File::Slurp 9999.12 Screenshot
File::Slurp 9999.12 Keywords
Slurp 9999.12
DATA
Perl module
file
read
filename
files
module
slurp
File::Slurp
FileSlurp
File::Slurp 9999.12
Libraries
Programming
Bookmark File::Slurp 9999.12
File::Slurp 9999.12 Copyright
WareSeeker periodically updates pricing and software information of File::Slurp 9999.12 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of File::Slurp 9999.12 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
File::BasicFlock is a Perl module for file locking with flock. Free Download
RPM::Util::Files is a Perl module to generate %files list in RPM Specfile. Free Download
Similars is a Perl module that can locate similar files. Free Download
File::Remove is a Perl module to remove files and directories. Free Download
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. Free Download
MikMod Utilities is a collection of tools for manipulating the module sound files that are produced by tools like Soundtracker. Free Download
IO::InSitu is a Perl module to avoid clobbering files opened for both input and output. Free Download
ConfigFile for Haskell is a configuration file parser and writer library for Haskell. Free Download
Latest Software
Popular Software
Favourite Software