Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
use File::Slurper 'read_text';
my $text = read_text($filename, $data);

View file

@ -0,0 +1,2 @@
use Path::Tiny;
my $text = path($filename)->slurp_utf8;

View file

@ -0,0 +1,2 @@
use IO::All;
$text = io($filename)->utf8->all;

View file

@ -0,0 +1,4 @@
open my $fh, '<:encoding(UTF-8)', $filename or die "Could not open '$filename': $!";
my $text;
read $fh, $text, -s $filename;
close $fh;

View file

@ -0,0 +1,7 @@
my $text;
{
local $/ = undef;
open my $fh, '<:encoding(UTF-8)', $filename or die "Could not open '$filename': $!";
$text = <$fh>;
close $fh;
}

View file

@ -0,0 +1 @@
my $text = do { local( @ARGV, $/ ) = ( $filename ); <> };

View file

@ -0,0 +1 @@
perl -n -0777 -e 'print "file len: ".length' stuff.txt

View file

@ -0,0 +1,3 @@
use File::Map 'map_file';
map_file(my $str, "foo.txt");
print $str;

View file

@ -0,0 +1,4 @@
use Sys::Mmap;
Sys::Mmap->new(my $str, 0, 'foo.txt')
or die "Cannot Sys::Mmap->new: $!";
print $str;