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/.*$}{};
Perl 6 in German
Comment on
Re: Manipulating directory paths
Select
or
Download
Code
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.
[reply]
[d/l]
[select]
Re^3: Manipulating directory paths
by
Zen
(Deacon)
on Sep 07, 2007 at 18:06 UTC
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.
[reply]
In Section
Seekers of Perl Wisdom