* WATANABE Hirofumi (eban / os.rim.or.jp) [020603 12:38]:
> filelist = Dir.open(".").
>   grep(/^\d+(?:\.\d+)?$/).
>     map {|x| x =~ /^(\d+)(?:\.(\d+))?/; [ Integer($1), Integer($2) ]}.
>       sort {|a, b| (a[0] <=> b[0]).nonzero? || a[1] <=> b[1]}.
>         map {|x| x[0].to_s + (x[1] != 0 ? '.' + x[1].to_s : '')}
[...] 
> filelist = Dir.open(".").
>   grep(/^\d+(?:\.\d+)?$/).
>     map {|x| x =~ /^(\d+)(?:\.(\d+))?/; [ Integer($1), Integer($2), x ]}.
>       sort.
>         map {|x| x.last}
[...]
> filelist = Dir.open(".").
>   grep(/^\d+(?:\.\d+)?$/).
>     sort_by {|x| x =~ /^(\d+)(?:\.(\d+))?/; [ Integer($1), Integer($2) ]}
[...]
> filelist = Dir.open(".").grep(/^\d+(?:\.\d+)?$/).sort_by {|x| x.to_f}

Thanks!

It amazes me how similar these can be written to perl's constructs in a
language which is so object-oriented.

Rick
-- 
 http://www.rickbradley.com    MUPRN: 404    (92F/98F)
                       |  lunches. please pay soon
   random email haiku  |  or else you may starve. haha
                       |  TGIT see ya later.