use 5.010; use strict; use warnings; use Convert::Binary::C; use Config; my $c = Convert::Binary::C->new; $c->Include( '/usr/include', '/usr/include/x86_64-linux-gnu/sys/', '/usr/include/x86_64-linux-gnu/' )->Define('__WORDSIZE=64'); $c->parse_file('/usr/include/x86_64-linux-gnu/sys/time.h'); my $timeval = $c->pack( 'struct timeval', { tv_sec => 1, tv_usec => 0 } );