File::Slurp::Tiny(3)
π NAME π
okay bestie, welcome to the File::Slurp::Tiny(3) manual page β this is the one from User Contributed Perl Documentation, and itβs literally called File::Slurp::Tiny π«Ά. The official vibe is βA simple, sane and efficient file slurper [DISCOURAGED]β π
. Yes, that [DISCOURAGED] is part of the tagline, no cap.
π VERSION π
version 0.004 β¨
π¦ SYNOPSIS π¦
use File::Slurp::Tiny 'read_file';
my $content = read_file($filename);
Thatβs the whole little intro, bestie β import read_file and slurp a file into $content π.
π¨ DISCOURAGED π¨
Okay so this is the important part: this module is discouraged in favor of File::Slurper π. While it was a useful experiment, it turned out to be both too similar to File::Slurp β it still contains most problematic features of File::Slurp's interface β and yet not similar enough to be a true drop-in replacement π.
Bugs will still be fixed, but new features will probably not be added π«Ά. So like, bug fixes are still on the table, but new features probably arenβt.
π DESCRIPTION π
This module provides functions for fast and correct slurping and spewing β¨. All functions are optionally exported π
π FUNCTIONS π
πΈ read_file($filename, %options) πΈ
Reads file $filename into a scalar π. By default it returns this scalar. Can optionally take these named arguments:
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_filewill return a reference to a scalar containing the file content π.
π¦ read_lines($filename, %options) π¦
Reads file $filename into a list/array π. By default it returns this list. Can optionally take these named arguments:
binmodeβ set the layers to read the file with. The default will be something sensible on your platform π.array_refβ pass a reference to an array to read the lines into, instead of returning them by value. This has performance benefits β.chompβchompthe lines βοΈ.
π write_file($filename, $content, %options) π
Open $filename, and write $content to it βοΈ. Can optionally take this named argument:
binmodeβ set the layers to write the file with. The default will be something sensible on your platform π.
π read_dir($dirname, %options) π
Open dirname and return all entries except . and .. π. Can optionally take this named argument:
prefixβ this will prepend$dirto the entries π.
π SEE ALSO π
Path::Tinyβ A minimalistic abstraction not only around πFile::Slurpβ Another file slurping tool π₯€
π AUTHOR π
Leon Timmermans <leont@cpan.org> π«Ά
β COPYRIGHT AND LICENSE β
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.
and thatβs the whole page, bestie β footer sign-off time: this manual page came from perl v5.40.2, dated 2023-07-03, and itβs the File::Slurp::Tiny(3) page π
β¨.
π¦ where this page comes from
- alpine 3.22: perl-file-slurp-tiny-doc 0.004-r4 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms