in reply to Re^2: Inserting Text into Files within a Directory
in thread Inserting Text into Files within a Directory

Your best bet is to step through your code with the debugger (run it with perl -d) and see what the values of $dir and $file are before the call to open. See perldebug if you're unfamiliar with the debugger.

Also, you have use warnings and use strict commented out in your program. Uncomment them and see what happens.

-b