my $test = "this\nis\na\ntest"; my @foo = split /\n/, $test; print +join '*', @foo;