#! /usr/bin/perl use strict; use warnings; my @a; my $b = "abefcdghijklmn" ; $a[0]->[0] = "start 0" ; $a[1]->[0] = "start 1" ; for(my $i = 0; $i < 14; $i += 2) { my ($foo, $bar) = unpack("x$i A1 A1", $b) ; push @{$a[0]}, $foo; push @{$a[1]}, $bar; } foreach ( @{$a[0]} ) { print "$_\n" ; }