From: Frank Church Date: 2007-06-30T19:33:49+09:00 Subject: Re: Is there a nifty ruby hack for this set of commands? Frank Church wrote: > > I have this sequence of commands to write a list of values to a file > > f = File.new(configfile, File::CREAT|File::WRONLY, 0700) > header_commands.each {|x| f.puts x } > mysql_commands.each {|x| f.puts x } > dir_commands.each {|x| f.puts x } > scp_commands.each {|x| f.puts x } > > Is there a way to do something like > > [header_commands, mysql_commands, dir_commands, scp_commands] each {|x| > f.puts x } > > I know there must be a number of ruby ways to do it. > > Any examples? > > > - Frank Thanks for all the examples. With this kind of support, I think ruby is a great choice. - Frank -- Posted via http://www.ruby-forum.com/.