Project

General

Profile

Actions

Feature #14240

closed

warn four special variables: $; $, $/ $\

Added by akr (Akira Tanaka) over 6 years ago. Updated over 3 years ago.

Status:
Closed
Target version:
[ruby-dev:50393]

Description

I think the four special variables for separators should be deprecated.

$/    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

I feel many program doesn't work if they are set to non-default value.

Since they are global, not thread local,
we can not change these variables safely in a multi threaded program.

So, I think we should warn them (and delete them in future).


Files

warn-5-gvars.patch (2.31 KB) warn-5-gvars.patch jeremyevans0 (Jeremy Evans), 07/26/2019 11:15 PM
warn-5-gvars-v2.patch (5.44 KB) warn-5-gvars-v2.patch jeremyevans0 (Jeremy Evans), 07/29/2019 07:03 PM
warn-5-gvars-v3.patch (5.4 KB) warn-5-gvars-v3.patch jeremyevans0 (Jeremy Evans), 08/26/2019 12:57 AM

Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #14138: Define English.rb aliases by default and eliminate the libraryClosedActions
Related to Ruby master - Feature #5977: Remove $, and avoid perlish global variablesRejected02/07/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0