3 ms·
I heard Matz is going to remove the Perl special variables in Ruby 3.0. Can't think what the fuss is all about. They're pretty useful in command-line Ruby. I mo
by cutler 7y ago
I heard Matz is going to remove the Perl special variables in Ruby 3.0. Can't think what the fuss is all about. They're pretty useful in command-line Ruby. I moved from Perl to Ruby so I will be sad to see this bit of Perl heritage removed from Ruby. I mean for what gain?
- byroot 7y agoOnly a very small subset of them: https://bugs.ruby-lang.org/issues/14240 https://bugs.ruby-lang.org/issues/14240 $/ input record separator (default argument for "gets") $\ output record separator ("print" prints it at last) $, default separator for Array#join and print $; default separator for String#split As for the gain it's because these variables globally change the behavior of important core methods. They really aren't that useful, but can easily cause havoc.