Make sure the myfile.txt is in the same directory as mIRC.exe (same as $mircdir).
If it is not, you should provide the fullpath in $exists().