open(FLATFILE, ">> /tmp/flatfile.data" or die $!...);
..should read:
open(FLATFILE, ">> /tmp/flatfile.data") or die $!;
I don't know whether this is just an error you introduced while posting this question otherwise it should have given you an error.
Apart from that I can't see anything wrong with the file writing logic which leads me to a couple of conclusions:
Are you sure the permissions are correct? Chances are when you run it via the form it's not using same user account that it does at the command line - and that account may not have permission to write (which is likely as most "web-user" accounts on servers have very few permissions by default for security reasons).
What platform/OS etc is this running on may I ask?
--- Jay
All code is untested unless otherwise stated.
All opinions expressed are my own and are intended as guidance, not gospel; please treat what I say as such and as Abigail said Think for yourself.
If in doubt ask.
|