my $str1 = q{abc}; my $str2 = q{zyxwvut}; my $template = q{A5A5}; my $packed = pack $template, $str1, $str2; print qq{>$packed<\n};