05 Aug 2016 16:28:39 UTC
- Distribution: File-Slurper
- Module version: 0.009
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (2534 / 1 / 1)
- KwaliteeBus factor: 1
- 80.99% Coverage
- License: perl_5
- Perl: v5.8.0
- Download (15.49KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:17 non-PAUSE users
- SEE ALSO
- COPYRIGHT AND LICENSE
File::Slurper - A simple, sane and efficient module to slurp a file
use File::Slurper 'read_text'; my $content = read_text($filename);
This module provides functions for fast and correct slurping and spewing. All functions are optionally exported.
$filenameinto a scalar and decodes it from
$encoding(which defaults to UTF-8). If
$crlfis true, crlf translation is performed. The default for this argument is off. The special value
'auto'will set it to a platform specific default value.
$filenameinto a scalar without any decoding or transformation.
$filenameinto a list/array line-by-line, after decoding from
$encoding, optional crlf translation and chomping.
$filename, encoding it to
$encoding(which defaults to UTF-8). It can also take a
crlfargument that works exactly as in read_text.
$filenameas binary data.
dirnameand return all entries except
This module tries to make it as easy as possible to read and write files correctly and fast. The most correct way of doing this is not always obvious (e.g. #83126), and just as often the most obvious correct way is not the fastest correct way. This module hides away all such complications behind an easy intuitive interface.
This module has an optional dependency on PerlIO::utf8_strict. Installing this will make UTF-8 encoded IO significantly faster, but should not otherwise affect the operation of this module. This may change into a dependency on the related Unicode::UTF8 in the future.
A minimalistic abstraction handling not only IO but also paths.
An attempt to expose as many IO related features as possible via a single API.
This is previous generation file slurping module. It has a number of issues, as described here
This was my previous attempt at a better file slurping module. It's mostly (but not entirely) a drop-in replacement for File::Slurp, which is both a feature (easy conversion) and a bug (interface issues).
Leon Timmermans <email@example.com>
This software is copyright (c) 2014 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.
Module Install Instructions
To install File::Slurper, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install File::Slurper
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|