in reply to setting hash keys by array
sub nested { return ( shift, (@_) ? { nested(@_) } : 1 ) } my %hash = nested(qw(red green brown)); [download]