[rt-users] Preventing auto-response for a particular requestor

Alan Barrett apb at cequrux.com
Sat Oct 2 11:00:42 EDT 2004


On Fri, 01 Oct 2004, Ronan Mullally wrote:
>   {
>     if($self->TicketObj->RequestorAddresses() =~ "email at address") {
>       return(undef);
>     } else {
>     return(1);
>   }
> 
> I think I'm missing something obvious, what is it?

The right hand side of the =~ operator is an regular expression, not a
string.  Also, "@" is a special character in a Perl double-quoted string
(it does an array interpolation), and regular expressions are usually
subjected to the same sort of parsing as double-quoted strings.  Finally
remember that "." is a special character in regular expressions.  So you
probably want something more like

    if($self->TicketObj->RequestorAddresses() =~ /email\@address\.example/)

or

    if($self->TicketObj->RequestorAddresses() eq "email\@address.example")

or

    if($self->TicketObj->RequestorAddresses() eq 'email at address.example')


--apb (Alan Barrett)



More information about the rt-users mailing list