Into an array:
chomp (my @data = <DATA>); print "$_\n" for @data; __DATA__ one two three
Iterating over it as a file handle without saving into an array:
while (<DATA>){ chomp; print "$_\n"; } __DATA__ one two three
In reply to Re: from txt file to array
by stevieb
in thread from txt file to array
by WisDomSeeKer34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |