http://www.perlmonks.org?node_id=1233230


in reply to Re: How to get 0 to initialize a value
in thread How to get 0 to initialize a value

Perl Best Practices (chapter 6; don't have dead tree version handy so no clue on a page number) recommends laying chained ternary expressions out as a table. If you squint it almost looks haskelly.

# Name format... # Salutation... my $salute = $name eq $EMPTY_STR ? 'Dear Custome +r' : $name =~ m/ \A((?:Sir|Dame) \s+ \S+) /xms ? "Dear $1" : $name =~ m/ (.*), \s+ Ph[.]?D \z /xms ? "Dear Dr $1" : "Dear $name" + ;

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