while (scalar(@ra)) { while (scalar(@rb)) { while (scalar(@rc)) { # rest } } }