Problems? Is your data what you think it is? | |
PerlMonks |
Re: if (open(FH, $path)) { ?by haoess (Curate) |
on May 03, 2004 at 14:48 UTC ( [id://350026]=note: print w/replies, xml ) | Need Help?? |
If you use -r, -w, -x etc. in your programm, be sure not to get race conditions. These are often misused functions. The right way is: Try to do what you want (= read file), and print an error message if that fails. The other way round is: Can I do this, can I do that? and then perform your action. This is the race condition, because between your tests and your action many things can change (i. e. file permissions). -- Frank
In Section
Seekers of Perl Wisdom
|
|