program shows the difference in results in using scalar
variables and array variables in retrieving data from a file. We
first assign a file name to a scalar variable ($DNA) for our
program. We then use the open command to open the file. The
command <dna1> reads the first line of the file and stores the
value in the scalar variable $DNA2. A scalar variable can hold
only one value at a time and hence the next lines of the file
are not stored in the variable instead it skips to the next line
where the close command is issued. So the variable $DNA2
contains only the first line of the file. test is to use an
array. In line 9, the first line of the file is read and stored
in the array variable @DNA2. Since the variable is an array all
the lines from the file can be read and stored into this array.
Each line would be stored as one value of the array. Once the
file is read completely the program goes to the next line where
the file is closed. now like to join all the values of the array
$DNA2 into one complete strin