in reply to How to perform recursion in any OS?

Instead of `ls -a $path`, which doesn't work for filenames containing spaces, anyway, use glob, or File::Find or File::Find::Rule, Path::Tiny etc.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: How to perform recursion in any OS?
by betterworld (Curate) on Dec 08, 2016 at 07:48 UTC

    I prefer Path::Class for listing directories:

    use Path::Class qw(dir); my @files = map {$_->basename} dir($path)->children;

    Also check out the docs (perldoc Path::Class::Dir) about the "recurse" function.

    In any case, there are many other reasons why you should never write code like `ls -a $path`. Have you thought about the possibility that $path includes the string "; rm -rf /"?