perl script code

JJB Barbish3 at adelphia.net
Fri Jun 18 08:45:21 PDT 2004


I have this


      #("Scan line for word abuse,");

      if ((/(abuse\@.*?)\s/) || (/(anti-spam\@.*?)\s/))
      {
       if (${1} eq "abuse\@slt.lk>") { $abuse_email =
"abuse\@slt.lk"; next; }
       if (${1} eq "abuse\@sunrise.net>") { $abuse_email =
"abuse\@sunrise.net"; next; }
       if (${1} eq "abuse\@tele2.it>") { $abuse_email =
"abuse\@tele2.it"; next; }
       if (${1} eq "abuse\@swip.net>") { $abuse_email =
"abuse\@swip.net"; next; }
       if (${1} eq "abuse\@tiscali.fr\"") { $abuse_email =
"abuse\@tiscali.fr"; next; }
       if (${1} eq "abuse\@cpcnet-hk.com\"") { $abuse_email =
"abuse\@cpcnet-hk.co"; next; }
       if ((${1} =~ /\@apnic.net/i) || (${1} =~ /\@lacnic.net/i))
       {
        next;
       }
       else
       {
        $abuse_email = ${1};
        debug("abuse_email body = $abuse_email\n");
       }
      }

How can I rewrite the
       if (${1} eq "abuse\@slt.lk>") { $abuse_email =
"abuse\@slt.lk"; next; }
       if (${1} eq "abuse\@sunrise.net>") { $abuse_email =
"abuse\@sunrise.net"; next; }
       if (${1} eq "abuse\@tele2.it>") { $abuse_email =
"abuse\@tele2.it"; next; }
       if (${1} eq "abuse\@swip.net>") { $abuse_email =
"abuse\@swip.net"; next; }
       if (${1} eq "abuse\@tiscali.fr\"") { $abuse_email =
"abuse\@tiscali.fr"; next; }
       if (${1} eq "abuse\@cpcnet-hk.com\"") { $abuse_email =
"abuse\@cpcnet-hk.co"; next; }

part so I can check the last position of what ever is found for > \
/ ) } ] and delete those unwanted characters from value that gets
loaded into $abuse_email???




More information about the freebsd-questions mailing list