Stoned Elipot wrote: > > Hi, > I tried to track the following problem - well at least to me it seems that > there's a problem somewhere - into ruby 1.6.2-preview sources > without clear success. > > Can someone please give me a hint ? > > $ ruby -v > ruby 1.6.2 (2000-10-18) [sparc-netbsd1.4.1] > $ echo 'p Integer("zzzzzzzz")' | ruby > -:1:in `Integer': invalid literal for Integer: zzzzzzzz (ArgumentError) > from -:1 > $ echo 'p Integer("zzzzzzzzz")' | ruby > 0 > $ Maybe you want "zzzzzzzzz".to_i, which returns 0. to_i ignores leading/following characters that aren't in the 0-9 range and so never causes errors. Integer() is interested in a base radix, like "0x", and raises an exception if it sees a bad one. That is to say, it is probably right to complain about a zexadecimal number. :-)