in reply to delete something from a variable

$var =~ s/\/[^\/]+//;
should do the trick - match a forward slash (\/), then match one or more non-forward slashes ([^\/]+).

If you don't like having to escape those forward slashes, you can choose another token - i prefer braces because they don't bork my syntax highlighter:

$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)

Replies are listed 'Best First'.
Re: (jeffa) Re: delete something from a variable
by Anonymous Monk on Jul 06, 2002 at 20:53 UTC
    actualy I need to delete it at the end of $var
      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)