For the book "mastering algorithms with perl"