open (FILE, "<my_file") || die "can't open my_file: $!"; my @stuff = <FILE>; # get whole file into array close(FILE); chomp @stuff; # cut out trailing newlines my $string = join(', ', @stuff); # join to one string undef @stuff; # clean up behind us
In reply to Re: How do i read each line of the file into string?
by alfie
in thread How do i read each line of the file into string?
by anjaana78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |