my ($tmp, $prev); # ...loop here if (@tmp == 1) { @prev = @tmp; next; }