use Win32::API; use Win32::API::Struct; $Win32::API::DEBUG = 1; Win32::API::Struct->typedef( test => qw(char i; long l;) ); my $b = Win32::API::Struct->new( 'test' ); print $b->sizeof; #### (PM)Struct::recognize got 'i', 'char' -> 'c' (PM)Struct::recognize got 'l', 'long' -> 'l' (PM)Struct::new: got 'test' (PM)Struct::sizeof: sizeof with member(i) now = 1 (PM)Struct::sizeof: sizeof with member(l) now = 5 (PM)Struct::sizeof first=1 align=4 (PM)Struct::sizeof returning 8 8