Unless I've misunderstood the question, I think that the solution offered by both
moritz &
linuxer have missed the point - AFAICT, the OP appears to be experiencing problems actually opening files c/w reading a successfully opened file.
Never having used a Mac (thus not being aware of the pitfalls), my only suggestion would be to change:
@files = <*.tx>;
to read:
@files = <*.tx>;
chomp @files;
thus removing any trailing whitespace from the filename(s).
A user level that continues to overstate my experience :-))