In a message dated 12/11/2002 12:00:43 PM Pacific Standard Time, 
[EMAIL PROTECTED] writes:


>     How about this: 
> 
>     $list =~ s|/$name||; 
>     $list =~ s|^/||; 
> 
>     If it's at the end, it will remove the last /. 
>     If it's in the middle it will fill in correctly. 
>     If it's on the front the second regex will take care of it. 

If it's on the front, it won't remove it because it doesn't have a preceeding 
/ in that case.  If you add a ? to the first one, it does get it down to two 
statements:
$list =~ s|/?$name||;
$list =~ s|^/||;

Reply via email to