Created
December 13, 2012 17:39
-
-
Save ilmari/4278187 to your computer and use it in GitHub Desktop.
suggested ternary wrapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my %types = map { | |
my $t = defined($params->{"${_}_type"}) ? $params->{"${_}_type"} | |
: is_blessed($params->{$_}) ? $params->{$_}->item_type | |
: defined($params->{$_}) && @{$params->{$_}} ? $params->{$_}->[0]->item_type | |
: undef; | |
defined($t) ? ($_ => $t) : () | |
} qw(container containee); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment