Subject: | why pass scalar? |
I think it's very odd that $string must be passed as a reference. It's pretty unnatural. This module might make more sense if it took a plain ol' string.
Also, passing the hashref returned by $count back to &percentage is weird. Why not have percentage call count on its own. If you're concerned about optimization, let $count be passed optionally.