in reply to Re: Substitution Trickery
in thread Substitution Trickery

dragonchild has the right answer, but you could improve the readability of the statement various ways:
$served =~ s!/$!! if $served =~ m!^/.+/$!; or $served =~ s!/$!! if $served =~ m!^/.!; or $served =~ s!(^/.+)/$!$1!;