Open
Conversation
Contributor
|
I suggest this more concise alternative, which I think reads more clearly: diff --git a/lib/Path/Tiny.pm b/lib/Path/Tiny.pm
index 58862e4..66faff3 100644
--- a/lib/Path/Tiny.pm
+++ b/lib/Path/Tiny.pm
@@ -1364,8 +1364,8 @@ If C<binmode> is provided, it will be set on the handle prior to reading.
If a positive C<count> is provided, that many lines will be returned from the
start of the file. If a negative C<count> is provided, the entire file will be
-read, but only C<abs(count)> will be kept and returned. If C<abs(count)>
-exceeds the number of lines in the file, all lines will be returned.
+read, but only the last C<abs(count)> lines will be kept and returned.
+If C<abs(count)> exceeds the number of lines in the file, all lines will be returned.
If C<chomp> is set, any end-of-line character sequences (C<CR>, C<CRLF>, or
C<LF>) will be removed from the lines returned. |
Mention that a negative count returns the last lines read.
Author
|
Thanks, that reads much better to me, too. I'll update the PR. If merged, please consider it attributed to @ap |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add additional wording for a negative count.
--
came up in libera
#perl, there was confusion that "the last X lines" wasn't mentioned.