Matt Neuburg wrote:
> I am using popen to pipe some text through a Perl script and I've just
> discovered (accidentally) that the pathname for this script has to be
> explicitly escaped - it must not contain unescaped spaces. This
> surprised me because elsewhere in Ruby this does not appear to be the
> case (in "require", for example). What is the rule here? Thx - m. 

It's a shell thing...

pipe = IO.popen("ls *", "r")

doesn't look for a program named "ls *".

It's like the difference between

  system("ls *")

and

  system("ls", "*")

except that in the case of IO.popen there is no (AFAICT) way to do the 
latter. On platforms with fork() you can emulate it:

IO.popen("-", "r") do |pipe|
   if pipe
     puts pipe.read
   else
     exec "ls", "*" # error if there is no file named "*"
   end
end

-- 
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407