print join("\n",split(/\~/,$var1))."\n";
Rather than concatenating a newline why not place an empty string at the end of the things to be joined.
$ perl -e ' > $var1 = q{abc~123~def}; > print join qq{\n}, split( m{~}, $var1 ), q{};' abc 123 def $
I hope this is of interest.
Cheers,
JohnGG
In reply to Re^2: split and print
by johngg
in thread split and print
by sans-clue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |