in reply to Re: split and join, what's the clever way to do it
in thread split and join, what's the clever way to do it

The first argument to split is a regex, not a string. It makes a difference.

$ perl -le '$line = "a|b|c|d"; print "-- $_:\n", join( "\n", split( $_ +, $line ) ) for ( qr/\|/, "|" )' -- (?-xism:\|): a b c d -- |: a | b | c | d

The cake is a lie.
The cake is a lie.
The cake is a lie.