Use an else-if ladder instead of given-when.

Since given-when is experimental as of Perl 5.18 (sigh).