use 5.010; my $_ = "/home/code/work"; my @paths; again: unshift @paths, $_; s!/[^/]*$!! and length $_ and goto again; say "@paths"; __END__ /home /home/code /home/code/work
In reply to Re: Regular expression parse pathname
by JavaFan
in thread Regular expression parse pathname
by unixguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |