Jan Svitok wrote:
> On 10/5/06, Tom Allison <tallison / tacocat.net> wrote:
>> Found a buddy who used something like:
>>
>> hostname = open("|hostname").gets
>>
>> And...
>>
>> I see that it works, but I don't find any of the documentation that 
>> makes sense.
>>
>> So -- it seems to be IO class, but how?  There's no IO declaration there.
>> Also, I can't find anything that says you can open a command with a 
>> preceding
>> pipe and get the output of the executed command.
>>
>> I'm familiar with perls open: open(FH, "hostname |") with a suffixed 
>> pipe --
>> which is consistent with unix pipe usage.
>>
>> But can someone explain to me what's going on here so my brain doesn't 
>> implode?
>>
> 
> http://ruby-doc.org/core/classes/Kernel.html#M001989
> 


OK, I missed the "Kernel#open" in the list of where I can use open.  NOTE: the 
list from 'ri' could be better formatted.

What's with the pipe being at the wrong end?
What's the thinking behind that?