in reply to file with a blank in its name

I know this doesn't really answer your question, but I would really recommend using

@files = glob("*"); rather than @files = <*>;

Using the glob function makes your code far clearer. Imagine someone new to Perl looking at your script -- even finding entries for < > in the manual are going to be harder!