my $user; $user->{'host'} = '*'; # scalar one element # if $user->{host} is not a reference create a reference to a array $user->{host} = [ $user->{host} ] unless ref $user->{host}; #### $user->{host} = [ '*' ];