The subject says it all, the output file is full of little squares and the html it is supposed to have. It works fine as an SSI but it grows exponentially so I can't use it. Additionally when the line with the flock isn't commented out I get a compilation error, any idea why?
TIA
jg
open (FH, "+< $path_to_text") or die "where's the damn file? : $!"; #flock (FH,LOCK_EX) or die "Couldn't flock: $!"; #why does flock result in compilation errors? my @old_file = <FH>; truncate (FH,0) or die "Can't truncate: $!"; print FH "<TR> <TD> <H3> $topic by <a href=mailto:$name\@sludgefac +tor.com>"; print FH "$name</a> </H3> </TR> <P>\n"; print FH "<TR> <TD> $words <p> </TD> </TR><P>\n"; print FH @old_file; close FH or die "close damn you : $!";

_____________________________________________________
My name is Inigo Montoya...

In reply to 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.