Okay ... here is my shot at it ...

  1. With regard to the flock(FH, LOCK_EX) statement, are you exporting the constants for LOCK_EX from Fcntl? (eg. use Fcntl qw/:DEFAULT/;) If not, then you will have to use the corresponding values for these constants, rather than their name. eg. flock FH, 8 instead of flock FH, LOCK_EX
  2. As for the 'junk' ending up in your text file, my best guess on this is because you are using the " quote for your print statements which will result in the arguments to be interpolated and thus, rather than <TR> <TD> being printed to the file, the interpolated contents of the (non-existent) file handles TR and TD are printed. To correct this, change your "'s to use the non-interpolated quotes '.

Update - Apparently brackets are not interpolated within double-quotes .. Thanks for the save chipmunk :)

 

Ooohhh, Rob no beer function well without!


In reply to Re: Wht is my .txt file full of garbage? And why does this flock cause a compilation error? by rob_au
in thread Wht is my .txt file full of garbage? And why does this flock cause a compilation error? by jerrygarciuh

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.