All tests pass!

Ruby code matches Perl code, pretty much exactly.