The current working directory (cwd) of a script invoked by the webserver can differ from the dir your script resides. So when you use relative paths in your script (here ".") and you're not taking the cwd into account you're prone to errors. To make that clearer, open a shell to your script name, cd up (cd ..), then type "directory/scriptname" and see that is doesn't work.
To see what your cwd in the web environment is use the
Cwd-Module:
use Cwd;
print "currently working from: ", getcwd(), "\n";
Then you can change the path in your script or move the datafile accordingly.