Luke
6/10/2007 6:07:00 PM
One quick note about the Pick-axe book and ruby docs...
The example on page 148 for IO.popen:
pig = IO.popen("/usr/local/bin/pig", "w+")
pig.puts "ice cream after they go to bed"
pig.close_write
puts pig.gets
Includes the following comment:
"... it turns out that the pig program doesn't flush the output it
writes. Our original attempt at this example, which had a pig.puts
followed by a pig.gets, hung forever."
I don't have the pig latin program installed on my machine, so I can't
be sure about this, but I suspect Dave may have been running into
exactly the same issue I found here. It looks like the pig program
doesn't return an EOL character.