in reply to file handles and file input
Try:
while(my $string_parser = <IN>) { [download]
instead of while(<IN>) which reads a line into $_, then $string_parser = <IN> which reads the next line into $string_parser - effectively throwing away the previous line.