Changing interpreter options during runtime

Hi

Can the interpreter options be changed during runtime?

For example, I have tried the following, but they don’t
seem to work:

#!/usr/bin/env ruby
$-w = true
5;

whereas,

#!/usr/bin/env ruby -w
$-w = false
5;
produces
t:3: warning: useless use of a literal in void context

···


Jim Freeze

The light at the end of the tunnel may be an oncoming dragon.

Hi,

Can the interpreter options be changed during runtime?

Yes.

#!/usr/bin/env ruby -w
$-w = false
5;
produces
t:3: warning: useless use of a literal in void context

Because this warning is emitted while compiling, before
besetting $-w.

···

At Tue, 6 May 2003 22:02:33 +0900, Jim Freeze wrote:


Nobu Nakada