my %inits = ( 1 => [2, 0, 9], 2 => [5, 1, 10], 3 => [8, 0, 11], # rest of the values go here ); ($i, $p, $v) = @{$inits{$h}} if $inits{$h};