- :
while( my( $first, $second ) = map { ... } 1..2 ) {
...
}
, - , , , , :
. , while, . , . , (, )?
The best solution would be to somehow show what you are trying to do without showing the mechanics. Without knowing anything about your iterator, I could suggest that you decorate it with another method that returns two elements (or maybe an empty list if it is at the end):
while( my( $first, $second ) = $iterator->read_two ) {
...;
}
If this does not make the situation clear, decorate it with a method to ask a specific question:
while( $iterator->two_things_left ) {
my( $first, $second ) = $iterator->read_two;
...;
}
source
share