knoppix@Microknoppix:~$ perl -E ' > $text = q{Some txt\lineAnother line\lineLast line of text\line}; > say for do { > local $/ = q{\line}; > open $in, q{<}, \$text or die $!; > map { chomp; $_ } <$in>; > };' Some txt Another line Last line of text knoppix@Microknoppix:~$