From owner-freebsd-questions@FreeBSD.ORG Fri Jun 18 15:45:21 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45B8D16A4CE for ; Fri, 18 Jun 2004 15:45:21 +0000 (GMT) Received: from mta8.adelphia.net (mta8.adelphia.net [68.168.78.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id E07DF43D5A for ; Fri, 18 Jun 2004 15:45:20 +0000 (GMT) (envelope-from Barbish3@adelphia.net) Received: from barbish ([67.20.101.71]) by mta13.adelphia.net (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with SMTP id <20040618153803.XTFS16060.mta13.adelphia.net@barbish> for ; Fri, 18 Jun 2004 11:38:03 -0400 From: "JJB" To: "freebsd-questions@FreeBSD. ORG" Date: Fri, 18 Jun 2004 11:38:02 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: perl script code X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Barbish3@adelphia.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2004 15:45:21 -0000 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???