On Tue, 13 Aug 2002, Connie Chan wrote:

> regex method :
> $_ =~ s/^(.+)<\-(.+)$/$1/;

1) By default the regex engine tries to match the contents of $_, so your
   statement can be written as 
   s/^(.+)<\-(.+)$/$1/;
2) You don't have to escape '-' in this case, it assumes a special meaning 
   only when used inside a character class.
3) Avoid capturing when not needed, you could have written this as
   s/<-.+$//;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to