in reply to Re: File::Slurp read_file error
in thread File::Slurp read_file error

I tried chomp, but directory names had a ':' and \n to remove at the end and file names just a \n. I considered it more transparent for me to use the syntax I was using as I could track the directory and file processing easier.

I also needed to keep a hierarchical list of dirs. and files in order to retrieve them from the directory tree, so push would not be efficient for me. I may need to work on approx. 500K+ files, so I need to reduce memory usage as much as I possibly can.

substr($string,1,-2) as pointed out, was a typo on my part, should have read substr($string, 0, -2). Apologies for wasting your valuable time, but thank you.