I'm fairly new to perl so I'm sorry for the ignorance. I have written a script using flock that appends to a file. I believe that flock is working correctly, but my question is when I try to open the file should I still use die? So in other words, if the file is currently locked and someone else is trying to open it will it die or wait. Here is my code
open (UNSUB, ">>unsubscribe.txt") or die send_email("Open Unsubscribe. +txt$!\nUnsubscribe $surveyID"); flock (UNSUB, 2) or die send_email("Flock Unsubscribe.txt$!\nUnsubscri +be $surveyID"); print UNSUB "$surveyID\n"; close UNSUB;
In reply to use die with flock by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |