File::Slurper::Shortcuts - Some convenience additions for File::Slurper
This document describes version 0.001 of File::Slurper::Shortcuts (from Perl distribution File-Slurper-Shortcuts), released on 2018-09-22.
use File::Slurper::Shortcuts qw(replace_text replace_binary); replace_text("dist.ini", sub { s/One/Two/ });
Usage:
replace_text($filename, $code, $encoding, $crlf);
This is like File::Slurper's write_text except that instead of $content in the second argument, this routine accepts $code. Code will be have the file's content in $_, modify it, and return true. This routine will die if: file can't be read with read_text(), code does not return true, file can't be written to with write_text().
write_text
$content
$code
$_
read_text()
write_text()
Please visit the project's homepage at https://metacpan.org/release/File-Slurper-Shortcuts.
Source repository is at https://github.com/perlancar/perl-File-Slurper-Shortcuts.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=File-Slurper-Shortcuts
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
File::Slurper
perlancar <perlancar@cpan.org>
This software is copyright (c) 2018 by perlancar@cpan.org.
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::Slurper::Shortcuts, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Slurper::Shortcuts
CPAN shell
perl -MCPAN -e shell install File::Slurper::Shortcuts
For more information on module installation, please visit the detailed CPAN module installation guide.