Created
September 5, 2016 16:40
-
-
Save dogbert17/f348e0f69bb81feed1b2802222c2e28c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method slurp-rest | |
multi method slurp-rest(IO::Handle:D: :$bin!, :$close --> Buf) | |
multi method slurp-rest(IO::Handle:D: :$enc, :$close --> Str) | |
Returns the remaining content of the file from the current file position | |
(which may have been set by previous reads or by C<seek>.) If the | |
adverb C<:bin> is provided a L<Buf> will be returned, | |
otherwise the return value will be a C<Str> with the optional encoding C<:enc>. | |
Specifying the adverb C<:close> will cause the filehandle to be closed when | |
the call has finished. | |
=for code :skip-test | |
my $fh = open("content.txt"); | |
my $line = $fh.get; | |
my $rest-of-file = $fh.slurp-rest(:close); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment