File::Slurp::Tiny - A simple, sane and efficient file slurper
version 0.002
use File::Slurp::Tiny 'read_file'; my $content = read_file($filename);
This module provides functions for fast and correct slurping and spewing. All functions are optionally exported.
Reads file $filename into a scalar. By default it returns this scalar. Can optionally take these named arguments:
$filename
binmode
Set the layers to read the file with. The default will be something sensible on your platform.
buf_ref
Pass a reference to a scalar to read the file into, instead of returning it by value. This has performance benefits.
scalar_ref
If set to true, read_file will return a reference to a scalar containing the file content.
read_file
Reads file $filename into a list/array. By default it returns this list. Can optionally take these named arguments:
array_ref
Pass a reference to an array to read the lines into, instead of returning them by value. This has performance benefits.
chomp
chomp the lines.
Open $filename, and write $content to it. Can optionally take this named argument:
$content
Set the layers to write the file with. The default will be something sensible on your platform.
Open dirname and return all entries except . and ... Can optionally take this named argument:
dirname
.
..
prefix
This will prepend $dir to the entries
$dir
Path::Tiny
A minimalistic abstraction not only around
File::Slurp
Another file slurping tool.
Leon Timmermans <leont@cpan.org>
This software is copyright (c) 2013 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install File::Slurp::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Slurp::Tiny
CPAN shell
perl -MCPAN -e shell install File::Slurp::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.