Just to add to
pme's
solution: You are declaring
my ($col1,$date_and_time,$col2,$col3,$col4) within the while loop, so they go out of scope after each iteration.
However, even if you move the declaration outside the loop, you still would have
single values, so you'd end up printing the values of the very last input line.