From 913bc18761b5019492c30c0df9af7c5860a23bc3 Mon Sep 17 00:00:00 2001 From: knu Date: Thu, 19 Dec 2002 20:30:05 +0000 Subject: [PATCH] The use of $_ and ~/RE/ is discouraged. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/dir.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sample/dir.rb b/sample/dir.rb index 2465c4d68e..b627383946 100644 --- a/sample/dir.rb +++ b/sample/dir.rb @@ -2,8 +2,10 @@ # list all files but .*/*~/*.o dirp = Dir.open(".") for f in dirp - $_ = f - unless (~/^\./ || ~/~$/ || ~/\.o/) + case f + when /^\./, /~$/, /\.o/ + # do not print + else print f, "\n" end end