outputsmy $path='/foo/bar'; my @dirs=split(/\//,$path); $"='/'; $\="\n"; while (@dirs) { my $str="@dirs" || "/"; print $str; pop @dirs; }
Yves/foo/bar /foo /
In reply to Re: Trimming Paths with regexes
by demerphq
in thread Trimming Paths with regexes
by TGI
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |