Revert "Add ability to reverse read file contents"

This reverts commit dc62885a51.
This commit is contained in:
Ilia Rostovtsev
2020-12-14 01:36:32 +03:00
parent dc62885a51
commit d0340e5fff

View File

@@ -10219,7 +10219,7 @@ else {
}
}
=head2 read_file_contents(file, limit, reverse)
=head2 read_file_contents(file, limit)
Given a filename, returns its complete contents as a string. Effectively
the same as the Perl construct `cat file`.
@@ -10227,7 +10227,7 @@ the same as the Perl construct `cat file`.
=cut
sub read_file_contents
{
my ($file, $limit, $reverse) = @_;
my ($file, $limit) = @_;
&open_readfile(FILE, $file) || return undef;
local $/ = undef;
my $rv = <FILE>;
@@ -10248,10 +10248,6 @@ if ($limit) {
$rv = $s . $e;
}
}
if ($reverse) {
my @rva = split("\n", $rv);
$rv = join("\n", reverse @rva);
}
return $rv;
}