in reply to Re: Strange read file behaviourin thread Strange read file behaviour
open DIRECTORIES, "<", $source or die $!; while (<DIRECTORIES>) { s/\s+\z//; # Remove trailing whitespace, incl \r and \n ... } [download]