$inv->{ranges} = \@ranges; #### foreach my $range ( @{$inv->{ranges}} ) { ... }