All pastes #2583 Raw Edit

Anonymous

public text v1 · immutable
#2583 ·published 2004-12-02 21:41 UTC
rendered paste body
@search = (
[ 'ABANDON', 'position', 'origposition', 'waittime'] ,
[ 'AGENTDUMP', 'event' ] ,
[ 'AGENTLOGIN', 'channel' ] ,
[ 'COMPLETECALLER', 'holdtime', 'calltime', 'origposition'] ,
[ 'COMPLETEAGENT', 'holdtime', 'calltime', 'origposition' ] ,
[ 'CONFIGRELOAD' , 'event'] ,
[ 'CONNECT' , 'holdtime' ] ,
[ 'ENTERQUEUE', 'url', 'callerid' ] ,
[ 'EXITWITHKEY', 'key', 'position' ] ,
[ 'EXITWITHTIMEOUT', 'position' ] ,
[ 'QUEUESTART' , 'event' ] ,
[ 'SYSCOMPAT' , 'event' ] ,
[ 'TRANSFER' , 'extension', 'context' ]
) ;

$number_of_matches = @search ;

$file=File::Tail->new(name=>$filename, maxinterval=>1, adjustafter=>100, reset_tail=>0. );
while (defined($line=$file->read)) {
                for ($i=0; $i < $number_of_matches; $i++) {
                if ($line =~ $search[$i][0]) {
                foreach $new (@search->ref[0]) {print "$ref\n"; }
                               }
                              }
}