Maybe the script is being run from a different directory? Try chdir or using the full filename + path.
In reply to Re: Tie() doesn't work by eg in thread Tie() doesn't work by NeverMore