From perldoc -f pack: "When unpacking, A strips trailing whitespace and nulls, Z strips everything after the first null, and a returns data with no stripping at all."
For this purpose, you can use either a or Z. Because you're reading in ASCII text, a makes more sense visually as [Aa] is for ASCII text, and Z is used for null terminated ASCII (which you don't have here):
perl -E '@foo=unpack("a6a4", "Hello Joe "); say ">$_<" for @foo'
>Hello <
>Joe <
perl -E '@foo=unpack("Z6Z4", "Hello Joe "); say ">$_<" for @foo'
>Hello <
>Joe <