in reply to (dont want) split to autoremove "\n"'s
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
|
|---|