in reply to how to get the all the subdirectories path from the directory
If you're running this on a linux box, you could use backticks.
my @dirs = split(/\n/,`find /from/this/place/on -type d`);Nice thing about this is that you are using linux find, you can specify a lot of options, like formatting the output to get inode, timestamp, you can sort them by date, whatever.
You may want to do a man find from your shell prompt- it would show you the options.
You have to be aware that using backticks is more of a temporary script thing, for throw-away code. There are security and i guess portability issues with backticks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to get the all the subdirectories path from the directory
by graff (Chancellor) on Mar 09, 2006 at 23:27 UTC | |
by Anonymous Monk on Nov 06, 2013 at 02:32 UTC | |
Re^2: how to get the all the subdirectories path from the directory
by Anonymous Monk on Mar 19, 2015 at 21:05 UTC |
In Section
Seekers of Perl Wisdom