in reply to Perl script does not work on other directories?

Its because you used readdir but didn't read readdir documentation close enough

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

  • Comment on Re: Perl script does not work on other directories? (readdir pitfalls)
  • Download Code