Two comments: use Fcntl qw(:flock); and write flock FILE, LOCK_EX; instead of using the cryptic magic values. Also, don't unlock a locked file, ever, unless you know what you're doing - just close it and the lock will go away.
Did you check your error logs? Is the scripting dieing at the open? Btw, you should prefer the three argument form: open(FILE, ">>", "/data.txt").
If not, does your platform support flock at all? There should be something about that in your error log as well if that's the case.
Update: Also, why not use CGI.pm's perfectly fine cookie-generation functions?
print header(-cookie => cookie( -name => $name, -expires => $expires, -path => $path, -domain => $server_domain, -value => "there is none in your example", ));
Makeshifts last the longest.
In reply to Re: Writing to files
by Aristotle
in thread Writing to files
by rxguil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |