while (1) { my $a = or last; my $b = or last; # use $a and $b here }