From: Nit Khair Date: 2008-11-05T12:01:52+09:00 Subject: irb and ruby giving different results in IRB, ASCII = (0..255).map{|c| c.chr } PRINTABLE = ASCII.grep(/[[:print:]]/) PRINTABLE.length >>> 191 However, inside the ruby program PRINTABLE.length only gives 95 !! ??? #!/opt/local/bin/ruby ASCII = (0..255).map{|c| c.chr } puts(ASCII.length) PRINTABLE = ASCII.grep(/[[:print:]]/) puts(PRINTABLE.length) # -> 95 instead of 191 (Using ruby 1.8.7 on OS X 10.5.5, powerpc). Ran both from same Terminal. Both use /opt/local/bin/ruby. Why this difference? I ran irb with -f (so irbrc would not be loaded and still got the same result, so its not some require that is causing the difference). p.s. sorry for cross-posting from roguelike thread -- this is getting lost there. -- Posted via http://www.ruby-forum.com/.