r8test.rb
-------
sleep(4)
puts  "Data from subprocess: 10 20 30"



main_program.rb
--------------
puts "main program"
sleep(1)

pipe = IO.popen("ruby r8test.rb", "w+")

puts "main program executing while subprocess is sleeping"
Process.wait

pipe.close_write
puts pipe.gets

pipe.close_read
-- 
Posted via http://www.ruby-forum.com/.