in reply to Manipulating directory paths

If the part you want to strip off always starts with log/, that problem is not hard to solve:

$path =~ s{log/.*$}{};

Replies are listed 'Best First'.
Re^2: Manipulating directory paths
by jwkrahn (Abbot) on Sep 07, 2007 at 16:56 UTC
    The $ anchor is superfluous because .* is greedy and will always match to the end of the line.
      True. I know others who do this exact same thing with the dollar sign, but I think it is good for clarity when reading at a glance.