Yet another way to do it with the core module File::Spec:
my $path = "/home/temp/login"; use File::Spec; my @paths = File::Spec->splitdir($path); print "\"$_\"\n" for @paths; __END__ "" "home" "temp" "login"
The initial empty string at $paths[0] is due to the initial slash in the path (root directory).
In reply to Re: How to split "/"
by Anonymous Monk
in thread How to split "/"
by Jaycob777
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |