 |
Home:
Perl Programming Help:
Beginner:
Re: [ravi.joshi53] Reading all the files from a directory:
Edit Log
|
|

Zhris
Enthusiast
Sep 11, 2012, 1:49 PM
Views: 2442
|
Re: [ravi.joshi53] Reading all the files from a directory
|
|
|
Hi ravi, I had updated my code since you read, which I guess makes things more complicated with use of map too. I am using grep to ensure elements readdir returns that are not files (namely directories) are removed. Grep is fundamentally a list filter operation. If you are concerned, the map is used to translate the file_name into a full file_path rather than doing it inside the loop. I tested the code on Windows and the / file separator works fine (see the actual $dir_path I tested with below). I've actually never considered this issue before now (i'll look into it!).
my $dir_path = 'C:/Users/Chris/Desktop/Perl bits bobs'; Thanks, Chris
(This post was edited by Zhris on Sep 11, 2012, 1:52 PM)
|
|
Edit Log:
|
Post edited by Zhris
(Enthusiast) on Sep 11, 2012, 1:50 PM
|
Post edited by Zhris
(Enthusiast) on Sep 11, 2012, 1:51 PM
|
Post edited by Zhris
(Enthusiast) on Sep 11, 2012, 1:52 PM
|
|
|  |