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.

In reply to I must thank you all, and deeply apologize by Kozz
in thread More Eyes, Please by Kozz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.