in reply to How to split "/"
use File::Basename; my $d = "/home/temp/login"; my @b = (); while ($d ne dirname($d)) { # as long as we can move up directory t +ree, when we are at root the dirname won't change any more push @b, basename($d); $d = dirname($d) } print join "\n", reverse(@b)
Greetings,
Janek Schleicher
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to split "/"
by RonW (Parson) on Apr 28, 2014 at 19:18 UTC | |
by bigj (Monk) on Apr 29, 2014 at 15:15 UTC | |
by RonW (Parson) on Apr 29, 2014 at 16:04 UTC |