Not only does the code suggest that the candidate doesn't really know Perl, but all those lines that say $line = substr ($line,1)
are dreadful in any language. Try parsing a long line (say a few thousand fields) using that type of approach and you will see why. It just goes to show the sort of problem that Joel Spolsky discussed in this post.