I have a data file, with each line holding one number. I am trying to read this file into an array. Here is the script I wrote:
#!/usr/bin/perl -w
$file1 = '/home/usr1/test.list';
open(FILEC, $file1);
my @cArray = FILEC;
close FILEC;
print @cArray;
But after executing this file, nothing was printed out? I have checked the input, test.list, which is at the correct location. What may be the reason?
You’re missing the
<>(line) operator:ought to help.