my $ref = diff( ... ); for my $pair ( @{ $ref } ) { my( $start, $len ) = @{ $pair }; ## use start / len }