The error message from apache means it was looking for /var/www/test.txt, just what you wanted.
in reply to mod_perl PerlMapToStorageHandler
That it ultimately sent a 404 means it didn't find or couldn't access a file at /var/www/test.txt
To change that you either would have to put in a PerlResponseHandler too that generates a response or make sure that a file is accessible at /var/www/test.txt. Anonymous Monk already listed a few possibilities why it didn't work, another would be that apache doesn't have the rights to read /var/www/test.txt.
Disclaimer: I'm no expert of mod_perl, this answer is just theoretical reasoning not backed by actual experience