It looks quite obvious to me what makes the record separator. You are writing records called $guest to a file, and you append newlines to $guest just before storing it. Where else would you expect this to happen?

Now that you have posted all this code (of which most is completely pointless - if you have a question about your database, don't post dozens of lines of HTML generation, it makes it much harder to figure out what's going on), why are you opening the file new_guestbook.html for append if you truncate it to 0 bytes before prints? And why aren't you checking the return value of flock? What if the flock fails?

You should also realize that reading in the entire database and writing it out again is ineffecient. Why not just use a dbm file?

-- Abigail


In reply to Re: changing DB delimiters by Abigail
in thread changing DB delimiters by deriwana

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.