Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.471.366 Times

File::Slurp 9999.12

  Date Added: April 05, 2010  |  Visits: 779

File::Slurp

Report Broken Link
Printer Friendly Version


Product Homepage
Download (108 downloads)



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)..

Requirements: No special requirements
Platforms: Linux
Keyword: Data Efficient File Filename Fileslurp Libraries Module Perl Module Programming Read Slurp
Users rating: 0/10

License: Freeware Size: 26.62 KB
USER REVIEWS
More Reviews or Write Review


FILE::SLURP RELATED
Libraries  -  Pod::Hlp 1.02
Pod::Hlp is a Perl module that can convert POD data to formatted VMS HLP Help module text. SYNOPSIS use Pod::Hlp; pod2hlp("perlfunc.pod",$top_help_level,*Filehandle); Also: pod2hlp < input.pod Also: perl pod2hlb Pod::Hlp is a...
102.4 KB  
Libraries  -  Convert::PEM 0.07
Convert::PEM is Perl module that read/write encrypted ASN.1 PEM files. SYNOPSIS use Convert::PEM; my $pem = Convert::PEM->new( Name => "DSA PRIVATE KEY", ASN => qq( DSAPrivateKey SEQUENCE { version INTEGER, p INTEGER, q INTEGER, g...
20.48 KB  
File Cataloguers  -  File List Generator 1.0
ReStoring Data's File List Generator Freeware software filters, prints, and organizes via a file's: name, type, size, created date, and date last modified. It was developed by the Research and Development team to aid data recovery service clients...
5.63 MB  
Libraries  -  AnnoCPAN::XMLCGI 0.22
AnnoCPAN::XMLCGI is a Perl module to read XML input through a CGI.pm-like interface. SYNOPSYS use AnnoCPAN::XMLCGI; my $cgi = AnnoCPAN::XMLCGI->new; my $name = $cgi->param(name); print $cgi->header; print "Hello, $name!n"; # Hello, Bob!...
79.87 KB  
Libraries  -  dtRdr::Annotation::IO::YAML 0.0.11
dtRdr::Annotation::IO::YAML is a Perl module to read/write annotations from/to yml files. Methods init $io->init; items_for Return the hashrefs for a given book. @items = $io->items_for($book); insert $io->insert($object, %args);...
2.8 MB  
Libraries  -  Data::ICal::Entry::Alarm::Email 0.12
Data::ICal::Entry::Alarm::Email is a Perl module that represents an emailed alarm in an iCalendar file. SYNOPSIS my $valarm = Data::ICal::Entry::Alarm::Audio->new(); $valarm->add_properties( attach => [...
102.4 KB  
Libraries  -  File::Format::RIFF 1.0.1
File::Format::RIFF is a Perl module to Resource Interchange File Format/RIFF files. SYNOPSIS use File::Format::RIFF; open( IN, file ) or die "Could not open file: $!"; my ( $riff1 ) = File::Format::RIFF->read( *IN ); close( IN );...
9.22 KB  
Libraries  -  Test::File::Find::Rule 1.00
Test::File::Find::Rule is a Perl module to test files and directories with File::Find::Rule. SYNOPSIS use Test::File::Find::Rule; # Check that all files in $dir have sensible names my $rule = File::Find::Rule ->file ->relative...
3.07 KB  
Libraries  -  File::Next::OO 0.04
File::Next::OO is a Perl module with file-finding iterator Wrapper for File::Next::files function. SYNOPSIS File::Next::OO is just a wrapper around File::Next::files function. But it is easy to remember and less typing. Call it always with...
8.19 KB  
Libraries  -  File::Find::Closures 1.06
File::Find::Closures is a Perl module with functions you can use with File::Find. SYNOPSIS use File::Find; use File::Find::Closures qw(:all); my( $wanted, $list_reporter ) = find_by_name( qw(README) ); File::Find::find( $wanted,...
7.17 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB