for my $i (0 .. 3) { print "# $array[$i]{one}\n"; if (ref $array[$i]{one} eq 'SCALAR') { print "#\t${$array[$i]{one}}\n"; } }