in reply to Re^3: opening files: link checking and race conditions
in thread opening files: link checking and race conditions
Make sense? Dave_the_m's code will exactly perform the actions for P2, btw. (Eimi's earlier explanation did exactly what your code does, too - look it over, the -l check happens before and after.)P1: my $lflag = ( -l 'foo' ); # seems good P2: makes foo a link - uh oh! P1: $lflag or open my $fh, ">>foo"; # does it fine, since $lflag was s +et before P2: remove that link, lickity-split! P1: $lflag = ( -l 'foo' ); # whups, everything *seems* ok...
|
|---|