From: Rudolf Polzer Date: 2002-12-29T04:54:15+09:00 Subject: Re: block from string Scripsit ille Robert : > "Rudolf Polzer" schrieb: [...] > > ((ARGV.length() == 0) ? Dir["..?* .[^.]* *"] : ARGV).each() do |_| [...] > > And - note the ugly glob pattern. Is there something cleaner for "take > > everything from the current directory except . and .."? > > how about using "next": > > ( ARGV.empty? ? Dir : ARGV ).each() do |_| > next if _ == "." || _ == ".." Right, since it isn't useful or possible at all to rename '.' and '..'. > _2 = _.instance_eval( expr ) > puts "%s => %s" % [_, _2] > File.rename(_, _2) unless File.exists?(_2) > end -- [mpg123d] Just playing: .../09 back seat doll ga mite-ita - new recording.mp3 Das Patentsystem sollte man patentieren lassen, damit keiner davon Gebrauch machen kann... [Thunder auf debate@lists.ccc.de]