From owner-freebsd-questions@FreeBSD.ORG Sat Jun 19 00:22:41 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 1D40D16A4CE for ; Sat, 19 Jun 2004 00:22:41 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.192]) by mx1.FreeBSD.org (Postfix) with SMTP id 8CFDA43D2F for ; Sat, 19 Jun 2004 00:22:40 +0000 (GMT) (envelope-from aharrison@gmail.com) Received: by mproxy.gmail.com with SMTP id 62so269497rni for ; Fri, 18 Jun 2004 17:22:38 -0700 (PDT) Received: by 10.38.92.49 with SMTP id p49mr119220rnb; Fri, 18 Jun 2004 17:22:38 -0700 (PDT) Message-ID: Date: Fri, 18 Jun 2004 20:22:38 -0400 From: Andy Harrison To: barbish3@adelphia.net In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: cc: "freebsd-questions@FreeBSD. ORG" Subject: Re: perl ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2004 00:22:41 -0000 On Fri, 18 Jun 2004 16:34:38 -0400, JJB wrote: > > I have $email field that sometimes may not end with alpha character. > > How would I code if (last position of $email != alpha) { replace > last pos of $email with blank } > > Or any other coding method to strip off non alpha from $email field > if present. > > Thanks > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > Something along the lines of: my @foo = split( //, $email ); and then do one of these, pop @foo unless $foo[-1] =~ /[a-zA-Z]/; or to really want to replace it with a space, $foo[-1] =~ " " unless $foo[-1] =~ /[a-zA-Z] -- Andy Harrison