use warnings; use strict; my $str = '1234567890'; my @unpacked = unpack 'A1 x2 A1 X2 A1', $str; print "@unpacked";