struct mystruct{ int id[10]; char text[40]; unsigned short int len; #### my(@ids,$text,$length) = unpack("N10C40n",$buff) ;