perl ruby LR bug?

Thank you for share the code, deeply appreciated