#!perl -p s/if ([^in]+)n (\w+) else ([tf]\w+)/$1gt t?$2:$3/e&&redo