#!/usr/bin/perl use strict; use warnings; my @a = qw/one two three four five six seven /; $~ = "TEST"; print "---+++---\n"; my ($a1, $a2, $a3); while (@a) { $a1 = shift @a || "empty"; $a2 = shift @a || "empty"; $a3 = shift @a || "empty"; write; } print "---------\n"; format TEST = a: @* @* @* $a1, $a2, $a3 .