Project

General

Profile

Feature #12114

$VERBOSE = true is being ignored

Added by rovf (Ronald Fischer) over 3 years ago. Updated over 3 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:74007]

Description

This programm correctly complains about "assigned but unused variable - p"

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

However, this one doesn't

#!/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.

History

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Tracker changed from Bug to Feature
  • Description updated (diff)

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

It may be possible by executing BEGINs during parsing, but it needs renovations.

Also available in: Atom PDF