Issue #12114 has been updated by Nobuyoshi Nakada.

Tracker changed from Bug to Feature
Description updated

Thus is a spec now.
That warning is at parsing, but `BEGIN` blocks are executed after it.

It may be possible by executing `BEGIN`s during parsing, but it needs renovations.

----------------------------------------
Feature #12114: $VERBOSE = true is being ignored
https://bugs.ruby-lang.org/issues/12114#change-57162

* Author: Ronald Fischer
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
This programm correctly complains about "assigned but unused variable - p"

~~~ruby
#!/usr/bin/ruby -w
p=1
~~~

However, this one doesn't

~~~ruby
#!/usr/bin/ruby
BEGIN {$VERBOSE = true}
p=1
~~~

Setting `$VERBOSE` to true in a `BEGIN` block should have the same effect as providing it on the command line, but this is obviously not the case.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>