in reply to (jeffa) Re: delete something from a variable
in thread delete something from a variable

actualy I need to delete it at the end of $var
  • Comment on Re: (jeffa) Re: delete something from a variable

Replies are listed 'Best First'.
(jeffa) 3Re: delete something from a variable
by jeffa (Bishop) on Jul 06, 2002 at 20:59 UTC
    Ahhh, that's not /aasd then, is it? Seriously, just anchor the match - ^ for the beginning, $ for the end:
    $var =~ s{/[^/]+$}{};

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)