From: Gerry Ford Date: 2008-06-09T18:24:25+09:00 Subject: Re: picking through a script David Masover wrote: > On Sunday 08 June 2008 23:34:09 Gerry Ford wrote: > >> Is iconv something that comes already with ruby 1.8.6? > > Seems to. For what it's worth, isn't 1.8.7 out now? I've had this install for a while. Ruby was something I wanted to get to, but real life has been interfering. I might be behind one version. Since you said you got it to work, I went ahead and looked for anything in ruby that had iconv in it. There was an iconv.dll and an iconv.exe. I'd guess ruby.exe used iconv.dll. Here's some more of the script: RAW = ARGV.delete("-r") MBX = ARGV.delete("-m") def output(art, counter) if RAW File.open(filename(counter), "wb") {|out| out.puts art} else if MBX File.open("sent.mbx", "ab") do |out| out.print fromline(counter), LINEBREAK out.print reformat(art), LINEBREAK, LINEBREAK end else File.open(filename(counter), "wb") {|out| out.print reformat(art), LINEBREAK} end end end It looks like ARG.delete is a way to get command line args. How would this behave if no command-line args are given? -- -- Posted via http://www.ruby-forum.com/.