You can use a Look-behind assertion to keep the newlines and the spaces:
$ perl -MData::Dump -wE 'my $s = qq[\n</body> \n</html>]; my @array = +split(/(?<=\n)/, $s); dd \@array' ["\n", "</body> \n", "</html>"]
Good Day,
Dean
In reply to Re: (dont want) split to autoremove "\n"'s
by duelafn
in thread (dont want) split to autoremove "\n"'s
by endurocross
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |