my $item = { char => 'df', secs => 65, version => 4, misc => 'data', data => 'misc' }; # access with $item->{char} = 'ef'; # the print you asked for, outputs 0x0041 printf ("0x%04x", $item->{secs}); # what do you mean binary 0's? something like this? my @array = ("\000") x 10000;