Problem with readdir on < perl5.12 or maybe with oSX

rehash wasn't working for me - here's a fix