From: Han Holl Date: 2002-06-08T06:43:03+09:00 Subject: Re: Ruby pros: Please help...How to create multiple copies of Fil eA using names from FileB? Kurt Euler wrote: >Thanks, Park. I'll give this code a try. > >I'm a newbie, but its clear I need to get a more advanced Ruby guide before I can do this level of coding (even though I'm sure its elementary) on my own. > >Question: I've seen the "for line in file" in program samples like the one below. What's there a reason why this line-stepping technique would not have worked in my application? > > > # Count the words in a file # 1 > # 2 > filename = ARGV.shift # 3 > words = 0 # 4 > file = open(filename) # 5 > for line in file # 6 > words += line.split.length # 7 > end # 8 > file.close # 9 > # 10 > puts "Word Count: #{words}" # 11 > >I appreciate your help! > > > Well, ir worked for me. Maybe (if you are using a Unix variant) you have a permission problem ? Han Holl