From: nobu.nokada@... Date: 2004-01-10T11:21:12+09:00 Subject: Re: ANN: First release of Perl's Getopt::Declare for ruby Hi, At Fri, 9 Jan 2004 16:11:41 +0900, GGarramuno wrote: > >One suggestion: make it possible to apply to an arbitrary array, rather > >than just ARGV (or is this already possible?). > > Yes, it's possible, but you have to convert it to a space separated String > first (just use join ' '). What about strings contain spaces? And, you use this construnction several times, but I don't think you'd expect behavior as it works. def foo(*args) if defined?(args[0]) # ... Since args is defined here, so args[0] also is defined always. Ruby's `defined?' operator differs from Perl's `defined' function. BTW, I found a sample doesn't work expectedly. $ ruby ../samples/cmdline_pvtype.rb -blood AB Rh+ -blood => { '' => "", '' => "A" } -- Nobu Nakada