sub f { return wantarray ? (qw/L i s t e/) : 'Skalar'; } my %hash = ( key => f() );