From: Sam Duncan Date: 2012-02-07T04:39:04+09:00 Subject: Re: How to make a command-line string code block argument become a real block of code inside a script On 07/02/12 08:22, gabe gabriellini wrote: > If a exec > Ruby myprog.rb '{ print " hi body "}' > > How to convert that string to a real block to pass it to a method > > def what_u_ask&b > yield > End > > what_u_ask ARGV[0] > > > This does not work for me. Thank you. > This should work. def what_u_ask &b yield end eval "what_u_ask #{ARGV[0]}" Sam