--- Richie Crews <[EMAIL PROTECTED]> wrote:
> my $rahome = "/rahome/bridge_logs/logs/";
> my @bridges = ("80","81","82","83","84","85","86","87");
> my @checks = qw(alarm, ASSERTION, Bus, SYSERR, emt, bounce, arbitration,
> Address, died, EMT, FAILURE, Illegal,
> Retransmitting);

Richie,

This looks a bit odd to me.  Typically, when using qw//, the scalars are delimited by 
whitespace,
not commas.  Are you aware that the last characters of each of these scalars is a 
string?  If
you're unclear on this, try the following:

    my @checks = qw(alarm, ASSERTION, Bus, SYSERR, emt, bounce, arbitration,
                    Address, died, EMT, FAILURE, Illegal,Retransmitting);
    print "@checks\n";
    @checks = qw(alarm ASSERTION Bus SYSERR emt bounce arbitration
                 Address died EMT FAILURE Illegal Retransmitting);
    print "@checks\n";

Your parse_log() sub is, of course, what's taking up the time.  If you provide us with 
a little
sample data, that would help.  In particular, I'm looking at:

    $split[6] =~ /$string/

Also, in your foreach loop that checks for @checks, try using 'last' (perldoc -f 
last).  This will
break out of the loop as soon as you've found what you need.  Of course, if the array 
elements are
likely to contain more than one of the @checks (e.g. $split[6] = "alarm Bus emt" or 
whatnot), then
the last might be innapropriate.

    foreach $string (@checks) {
        #print "checking for $string\n";
        if ($split[6] =~ /$string/) {
            print "Ok found $string in $split[6]\n";
            last;
        } # end of if
        if ($split[7] =~ /$string/) {
            print "Ok found $string in $split[7]\n";
            last;
        } #end of if
    } # end of foreach

Cheers,
Curtis "Ovid" Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to