Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7444

ruby -e and global variables

Newsgroups comp.lang.ruby
Date 2021-09-24 05:51 -0700
Message-ID <43e02e5e-06a7-4a00-bcf8-69154b9c64fdn@googlegroups.com> (permalink)
Subject ruby -e and global variables
From "tcb...@gmail.com" <tcblues@gmail.com>

Show all headers | View raw


I'm trying to assign a global variable when using ruby -e
`ruby -e "$a=3"`
-e:1: syntax error, unexpected '='

So it seems I can't assign global variables when using ruby -e
What I wanted is to assign $stdout = StringIO.new
so I capture the output

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar


Thread

ruby -e and global variables "tcb...@gmail.com" <tcblues@gmail.com> - 2021-09-24 05:51 -0700
  Re: ruby -e and global variables August Werner <august-werner@invalid.invalid> - 2021-09-24 19:09 +0000

csiph-web