in reply to Converting a C structure to Perl

True you could use the pack command but perl programmers usually use an anonymous hash.
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;
For more information you might like to look at perldata and perlref from perldoc.