Documentation for routine slurp
Documentation for routine slurp, assembled from the following types:
Slurps the contents of the entire file into a
:enc optional named parameters, with the same meaning as open(). The routine will
fail if the file does not exist, or is a directory.
# read entire file as (Unicode) Str#my $text_contents = slurp "path-to-file";# read entire file as Latin1 Str#my $text_contents = slurp "path-to-file", enc => "latin1";# read entire file as Buf#my $binary_contents = slurp "path-to-file", :bin;
Slurp the entire contents of the file into a string.
multi method slurp(IO::Path: :, :)
Return the file content for this path, like slurp.