example 1: $a = "test test test"; $fmt = "A4 x1 A4 x1 A4 x1 A4"; @a = unpack($fmt, $a); print join ("*",@a); ^D x outside of string at - line 3. example 2: $a = "test test test "; $fmt = "A4 x1 A4 x1 A4 x1 A4"; @a = unpack($fmt, $a); print join ("*",@a); ^D test*test*test*