The database I'm using kind of skips around every once in a while. At first I thought it was because the limit of 1008 bytes per key (though I have no idea how many a-zA-Z characters are in equivelance to a byte) until I did some further testing.

  • test 1: Post 30 messages with a plain 50 character message. PASS
  • test 2: Post 30 messages with two face subs (smiley face/sad face). FAIL: DB broke apart at message 15
  • test 3: Post 30 messages with a non-separated word consisting with 400 characters. FAILED: DB broke up at message 10
  • test 4: Post 35 messages containing plain text for messages 1-14, image conversion using (smiley/sad face) for 15, 16-30 text, 31 for image conversion.. DB continued after one usage of a subs for an emoticon past message 20, after attempt of using a second s// DB crashed at message 30.

    It looks like as long as the messages aren't too long and they don't contain any special functions (making emoticons) the database and the script will run properly but if really lengthy one-word messages are sent or images are used the database likes to die at or around message 15-17.

    My ideas: None but I find it hopeful since it usually crashes around the same time. Do you have any suggestions (besides MySQL)? (by breaking apart I mean the contents from the DB are not printed out in insertion order. Insertion order is retained unless there are substitutions it looks like).

    if (param) { if ($name) { if ($message) { open( LOG, "$file" ); # open count log for ID $cnt = <LOG>; close(LOG); $cnt++; open( LOG, "> $file" ); print LOG $cnt; close(LOG); $name =~ s/</&lt\;/g; # removing exploit $message =~ s/</&lt\;/g; # removing exploit $name =~ s/$_/****/g for @words; # say goodbye to swear words $message =~ s/$_/****/g for @words; # say goodbye to swear words $message =~ s/:\)/\<img src=\"$imagedir\/smiley.gif\"\>/g; # happy emo +ticon $message =~ s/:\(/\<img src=\"$imagedir\/sad.gif\"\>/g; # sad emoti +con $message =~ s/:p/\<img src=\"$imagedir\/tongue.gif\"\>/g; # tongue em +oticon $message =~ s/:P/\<img src=\"$imagedir\/tongue.gif\"\>/g; # tongue1 e +moticon $message =~ s/:o/\<img src=\"$imagedir\/oh.gif\"\>/g; # oh emotic +on $message =~ s/:O/\<img src=\"$imagedir\/oh.gif\"\>/g; # oh1 emoti +con $message =~ s/\*hug\*/\<img src=\"$imagedir\/hug.gif\"\>/g; # hug emo +ticon $message =~ s/\*flower\*/\<img src=\"$imagedir\/flower.gif\"\>/g; # f +lower emoticon $message =~ s/\*wink\*/\<img src=\"$imagedir\/wink.gif\"\>/g; # wink +emoticon $message =~ s/\*devil\*/\<img src=\"$imagedir\/devil.gif\"\>/g;# devil + emoticon $message =~ s/\*love\*/\<img src=\"$imagedir\/love.gif\"\>/g; # love +emoticon $message =~ s/\*sleep\*/\<img src=\"$imagedir\/sleep.gif\"\>/g;# sleep + emoticon $message =~ s/\*conf\*/\<img src=\"$imagedir\/confused.gif\"\>/g;# sle +ep emoticon my $keeptime = join (':', $hour, $min, $sec); my $info = join ( '::', $name, $message, $keeptime ); $chat{$cnt} = $info; } else { print "Message was missing, data not sent.<br>"; } } else { print "Name was missing, data not sent.<br>"; } } foreach (reverse keys (%chatorder)) { my ( $name, $message, $time ) = split /::/, $chatorder{$_}; $message = wrap('', '', $message); print Tr(td({-width=>'700'},"<font color=blue>&lt;$name @ $time&gt +;</font>$message")), }


    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid

    20030627 Edit by Corion: Fixed runaway italics


    In reply to SDBM acting weird by sulfericacid

    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.