In the script, you can use the chown command to change the file ownership to your user. You can probably do this in native perl, but I'd just do:
system("chown user.group file");
is the user you're running the browser as, group
is the group to which that user belongs, and file
is the filename.