From: "Eregon (Benoit Daloze)" Date: 2022-07-16T10:06:13+00:00 Subject: [ruby-core:109228] [Ruby master Bug#18909] ARGF.readlines reads more than current file Issue #18909 has been updated by Eregon (Benoit Daloze). My two cents, options like `-i`/`-n`/`-p` shouldn't be used, I think they are vestigial legacy flags inherited from Perl or so. Ruby is expressive enough, it is short enough to have an explicit `File.write`, loop, or whatever you need without needing to rely on a lot of magic with these old flags (which make the logic unreadable). ARGF is well established as being the concatenation of all such files, there is no chance to change that. ---------------------------------------- Bug #18909: ARGF.readlines reads more than current file https://bugs.ruby-lang.org/issues/18909#change-98364 * Author: JohanJosefsson (Johan Josefsson) * Status: Closed * Priority: Normal * ruby -v: ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu] * Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED ---------------------------------------- The docuentation says that ARGF.readlines: *Reads ARGF's current file in its entirety* , but this is what happens: `$ cat fileA A $ cat fileB B $ ruby -e 'puts ARGF.readlines' fileA fileB A B` i.e. it reads both the current file and the next one (all files?). -- https://bugs.ruby-lang.org/ Unsubscribe: