in reply to RE: RE: A splitting question
in thread A splitting question

When I read these posts at first, I misunderstood the results of split. Before yesterday, I didn't realize that plain split also splits on newlines (although I knew!). So, the comment I wanted to make was, do a chop first. But of course that is unnessecary.

If you want it in an oneliner, you could just say: (The use of map releaves perl of doing an itteration.)

while(<>) {map { print "$_\n"} split; print "newline\n"}

If you combine this with little's post, you would get something like

undef $/; $_=<>; s/\n/ newline /g; map{ print "$_\n"} split;
Warning: Do not try to do something with $_ after the map, that doesn't work...

I was dreaming of guitarnotes that would irritate an executive kind of guy (FZ)