LoginSignup
1
0

More than 1 year has passed since last update.

Ruby — eval の変数代入を main に反映させる

Last updated at Posted at 2018-09-12

#!/usr/bin/env ruby

alice = nil

binding.eval('alice = "liddle"')

p alice # "liddle"

Ref

Versions

  • ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]

Links

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0