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
In reply to Re: Perl script does not work on other directories? (readdir pitfalls)
by Anonymous Monk
in thread Perl script does not work on other directories?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |