in reply to using STDIN that has no line breaks
What other people said to solve your specific problem.
Or in general: look at the variable $/ (the input record separator, newline by default. This influences Perl's idea of what a "line" is) in perlvar (perldoc perlvar from the command line).
In Section Seekers of Perl Wisdom