From: Patrick Joyce Date: 2006-04-14T15:36:14+09:00 Subject: Strange Integer() behavior I am learning Ruby and have encountered an error on a call to 'Integer("039")' in gems/ruby-web-1.1.1/lib/web/htmlparser/sgml-parser.rb while working on a little screen scraper project. Could someone please explain why the first three examples below succeed, but the fourth fails? patrick-joyces-computer:~/projects patrick$ ruby -e 'Integer("07")' patrick-joyces-computer:~/projects patrick$ ruby -e 'Integer("7")' patrick-joyces-computer:~/projects patrick$ ruby -e 'Integer("8")' patrick-joyces-computer:~/projects patrick$ ruby -e 'Integer("08")' -e:1:in `Integer': invalid value for Integer: "08" (ArgumentError) from -e:1 It seems that "01" - "07" and any numbers without a leading zero work, but any number greater than 7 with a leading zero throws an ArgumentError. Any advice would be greatly appreciated, as my program is failing on a certain page I am trying to scrape within the ruby-web gem and I am no where near confident enough to start messing around with those libraries. On the off chance that this is a versioning issue I am running Ruby 1.8.4 on OSX 10.4.6. Thank you in advance for your help. -- Posted via http://www.ruby-forum.com/.