#!perl -p 1while s/if (t?)\w+ then (\w+) else ([tf]\w+)/$1?$2:$3/e