in reply to Is My Split Or My Pattern Bad?

  1. Enable strict and warnings. That will help clean up a lot of your code.
  2. Your first if-statement will never execute. If $anal_entries is 0, that means $#msg is -1, which means that @msg contains nothing. If that was the case, you would never enter your for-loop.
  3. Your split looks fine, as far as it goes. But ...
  4. Can you create some dummy data, give it to us, and show us what you get when you run it? It's really hard to diagnose errors when we don't have all the info.
  5. I would strongly suggest you read Learning Perl, by Randal Schwartz published by O'Reilly & Associates. It looks like you came from a VisualBasic-type backround and are uncomfortable with Perl as a language.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^2: Is My Split Or My Pattern Bad?
by tc1364 (Beadle) on Nov 22, 2004 at 18:15 UTC
    Here is the dummy data being read in earlier in the code: Mon Nov 8 10:00:13 2004 Eat At Joes For ABCDEFGHILK Mon Nov 8 10:00:36 2004 Eat At Salleys For KLIHGFEDCBA Mon Nov 8 10:00:31 2004 Eat At Joes For EATATJOESOK Mon Nov 8 10:00:39 2004 Eat At Salleys For EATATSALLYS Below is what the code is putting out: Program Error 4 - KLIHGFEDCBA :Eat At Salleys Eat At Salleys Program Error 4 - EATATJOESOK :Eat At Joes Eat At Joes Program Error 4 - EATATSALLYS :Eat At Salleys Eat At Salleys Program Error 4 - ABCDEFGHILK :Eat At Joes Eat At Joes
      (It would help if you put things that have newlines in them between <code> tags.)

      It looks like the problem is in the building of the %nalysis hash. I would start there. Reason I know this - I doubt your keys should have a colon in them. :-)

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.