in reply to How do i read each line of the file into string?
my $string; # Open the file open(FILE, "$file_name") or die "could not open $file_name : $!"; # Iterate over each line of the file while (<FILE>) { # Take off trailing newline chomp; # Append line and comma to the string $string .= "$_,"; } # Close the file close(FILE); # Chop off trailing comma chop $string;
In Section
Seekers of Perl Wisdom