in reply to hanging script on read

You should always check the return value of open(). It may not be working.

And it looks like you might like File::Find::Rule.

The way forward always starts with a minimal test.