in reply to Perl script does not work on other directories?
Solution is simple, don't use readdir ;) use Path::Tiny qw/ path /; for my $kid ( path( $dir )->children ){ ...
If you read readdir you can see an that you can also chdir