This is brassmonk, I figured it out. I had a big (DA). Okay in the line which has "if (($2 >= $min) && ($2 <= $max)) {"

Well I tried "ge" in both of them prior to my post on accident I forgot to use "le" in the other. As soon as I did that it worked because I forgot that "ge" and "le" work with strings and "<=" or ">=" work with numbers. Anyway here's the revised script. Granted it's not everything I want yet but it's perty cool right now still working on it. Going to turn it into a CGI after I get the blasted thing to do what I want.
#!/usr/bin/perl -w 
use strict; 
my %mylist; 
my $min; 
my $max; 
my $range; 
my $line; 
# get the range (in this throwtogether it must be entered 
# with no spaces in the form HH:MM:SS.TS-HH:MM:SS.TS) 
# Get the range 
$range = <STDIN>; 
# Break up the range 
($min, $max) = split /-/, $range; 
# Squeeze out leading and trailing spaces 
$min =~ s/^\s+//; 
$min =~ s/\s+$//; 
$max =~ s/^\s+//; 
$max =~ s/\s+$//; 
# Open the datafile and break into fields 
open(FILE, "mon402.log");
while (<FILE>) {
if (s/<(.*?)>/TEXT/) {
if ($_ =~ m/(\d+\-\w+\-\d+)\s(\d{2}\:\d{2}\:\d{2}\.\d{2})\s+(\w*)/) {
# Push the restricted range of times onto a hash of arrays 
# keyed on the time field 
if (($2 ge $min) && ($2 le $max)) { 
push(@{$mylist{$2}}, $_); 
}
      }  
          } 
              }  
my @keys = sort (keys %mylist); 
foreach my $key (@keys) { 
foreach my $thing (@{%mylist}{$key}){ 
foreach my $it (@$thing) { 
print "$it\n"; 
last;
      } 
   } 
}
I did a few extra thingies. Anyway this is an SMS message log for cell phones and one of the new things is I eliminated customers text message text by making it say TEXT because it's a privacy liability and our company got sued because one of our customer care reps was reading them (To bad for him, he got the boot) Anyway now all it says is TEXT for the text(I love it) if (s/<(.*?)>/TEXT/) { I also improved the pattern match line. It's uglier than last time but it does see the fields, I like it when it looks cryptic like that! I had some test prints (print $1, $2, etc.) in there before to test if it sees separate fields and it did find the fields. (I love this stuff it's fun) So everything is cool now. Thanks for the help big time though. You people in this forum oops "monks" are so good at perl. I'm getting better but you guys rule at this perl. I'll get there someday. Anywho THANX!
DMH
brassmonk
Sorry I have no clever annotation or quote to spew out at the moment.

In reply to Re: pattern match or key problem by brassmon_k
in thread pattern match or key problem by brassmon_k

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.