From: David Alan Black Date: 2001-07-05T10:51:58+09:00 Subject: [ruby-talk:17265] Re: enhancing Ruby error messages for out of the bound constant Fixnum? On Thu, 5 Jul 2001, Guillaume Cottenceau wrote: > matz@ruby-lang.org (Yukihiro Matsumoto) writes: > > > [...] > > > |But with Ruby here, it silently does, well, I don't know: > > > > > > > > It considers the pattern /\068/ as \06 (octal 6) and following "8". > > Sould it parse like Perl's? > > Definitely, when you write \067 and then \068, you don't expect that one > is parsed as octal 67 and the other one octal 6 then 8. > > I think it should parse like Perl's.. I'm still not getting what the difference is, other than a warning from Perl and no warning from Ruby. candle:~/hacking/perl$ perl -lw $x = "\068"; print join ",", map { ord } split "", $x; $x =~ s/\068/x/; print $x; Illegal octal digit ignored at - line 1. Illegal octal digit ignored at - line 3. Illegal octal digit ignored at - line 3. ^D 6,56 x Both the string and the regexp are being parsed by Perl (5.005_03) as octal 6 followed by 8. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav