my @foo = split "\n|\r\f", $test; #### $test =~ s/\n/**/g; ## replace all \n with '**' $test =~ s/\r/!!/g; ## replace all \r with '!!' print STDERR qq/'$test'/;