From: Tamreen Khan Date: 2007-01-17T04:19:33+09:00 Subject: Re: Simple editing. Works in IRB; not as script. ------=_Part_60798_13385980.1168975170872 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/16/07, Peter Bailey wrote: > > Tamreen Khan wrote: > > On 1/16/07, James Edward Gray II wrote: > >> >> James Edward Gray II > >> > > >> > Duh, sorry James, but, I don't see what you mean. I don't have any > >> > (...) > >> > data in there. The test file I made is named "test1.txt.") > > > > > > You need to pass File.read a simple method argument, which goes inside > > parentheses, you don't need a block. > > > >I don't understand. My line says this: > > > >contents = File.read{"test1.txt"} > > > >I'm using parentheses, no block. I've done this in a number of other > >scripts, and, they work fine. Those aren't parentheses, they're braces, which means you're passing a block to it. You have to use ( instead of { . contents= File.read("test1.txt") > > > ------=_Part_60798_13385980.1168975170872--