Could anyone assist with this scrip?

This matches $match2 at every time, regardless if both $match1 and $match2 is 
present in the subject-line. Hence the If(index part is not working, any good 
perl-people that can correct it? Both matches must be present to not return 0;

my $match1 = "InformationX";
my $match2 = "[Y]";
my $subject = $self->TicketObj->Subject;
if (index(lc($subject), ($match1 && $match2)) eq -1)
{
return 0;
}
else {
return 1 if $self->TicketObj->IsWatcher(
    Type => 'Requestor', Email => 'email-adr...@se.se'
);
return 0;
}

Regards,


Från: rt-users [mailto:rt-users-boun...@lists.bestpractical.com] För Joel 
Bergmark
Skickat: den 5 oktober 2016 15:25
Till: rt-users@lists.bestpractical.com
Ämne: [rt-users] Match isWatcher and part of subjectline

Anyone has some cool code to match something like this: If iswatcher is <my 
match> then check if subject contains <my match2> return 1;  else return 0;

I cant get this simple stuff to work, perl isn't my thing :-)

Regards
---------
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Reply via email to