in reply to Testing if file exists

The key question is: the path in $mail_path is relative to what? Your Perl script won't necessarily start off in the directory where the program is located. Try running pwd to see if your current working directory is where you expect it to be when your CGI script runs:
print "DEBUG: `pwd`\n";
and if not adjust your link accordingly. If it's important to you that your program start off in the directory where it's located, there are various tricks you can use to achieve that; use SuperSearch to find them.