Try using some of the code below. A note of caution is that using map will create a 2d array. If you only have one line in the file they will all apear in the 0th element of the first dimension of the array. I hope this helps.
Donesh
Code:
sub getdata { my $filename = "<" . shift; open (HANDLE,$filename) or die "Cant Open $filename: $!"; my @final = map{chomp; [split/,/]} <HANDLE>; close HANDLE; return (@final); }
In reply to Re: How can I read a line of text from a file into an array?
by Donesh
in thread How can I read a line of text from a file into an array?
by fenners
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |