Hi all,
I am trying to perform a very basic action - read the contents of a .txt file into an array. However, I am losing
the first line of the file, which I suspect is because this has already been read into $_.
After opening the file, is there any way I can return the filehandle to the start of the file and then use the following to read the entire file into the array, as planned?
while(<FILEHANDLE>)
{
@array=<FILEHANDLE>;
}
close(FILEHANDLE);
#job done
This is probably really easy, but the help is always appreciated.
Thanks
I am trying to perform a very basic action - read the contents of a .txt file into an array. However, I am losing
the first line of the file, which I suspect is because this has already been read into $_.
After opening the file, is there any way I can return the filehandle to the start of the file and then use the following to read the entire file into the array, as planned?
while(<FILEHANDLE>)
{
@array=<FILEHANDLE>;
}
close(FILEHANDLE);
#job done
This is probably really easy, but the help is always appreciated.
Thanks