http://www.perlmonks.org?node_id=1029141


in reply to Require input reading files recursively in perl

readdir returns file names, not paths. To really access the file (as in opendir), you have to prepend the path to the file name.

Update: My comment is irrelevant to the problem. I was not able read the code properly because it was placed in the signature part of the post which renders without syntax highlighting and other bells and whistles I am accustomed to.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: Require input reading files recursively in perl

Replies are listed 'Best First'.
Re^2: Require input reading files recursively in perl
by jesuashok (Curate) on Apr 17, 2013 at 13:24 UTC


    As you can see from above code, when I call the function recursively, I am passing arguments by doing pre-pend the directory name so that the opendir would know what the directory it should open. Did I get that wrong? Feel free to correct.