in reply to
More Eyes, Please
I should have taken tilly's suggestion from the VERY
start and used Temp::File. And now I feel quite
foolish, but perhaps a little bit wiser, and I must acknowledge my folly
to the Perlmonks who've endured me.
Especially since the solution which would solve this mystery
was in none of the pieces of code I posted here. I realized
that the original block of code I posted in the parent thread
was in a subroutine which had been called by ANOTHER subroutine,
and in THAT subroutine I had already opened and flocked a
tempfile which had been created moments ago with the exact
same naming scheme.
So the most obvious solution was invisible to me late at night: "The file exists, and that's why you can't get a lock on it, dumbass!"
Thankfully things were clearer in the morning. I feel sooo silly.