This sounds like homework. Do yourself a favor and try to solve it yourself, otherwise your next test or exam will be a disaster. I'll give you two hints: Use a loop and take a look at the shift() function
Here is a simple solution with arrayref and one that can cope with array sizes not having multiples of threes
my $array= [1,2,3,4,5];
while (@$array) {
push my @r, shift @$array if (@$array);
push @r, shift @$array if (@$array);
push @r, shift @$array if (@$array);
print join(',',@r),"\n";
}