#!/usr/bin/perl -w use strict; use Data::Dumper; my @lanes = ( [(200900..202543)], [(202544..204187)], [(204188..205831)], [(205832..207475)], [(207476..210119)], [(210120..211763)], [(211764..213407)], [(213408..215051)], ); my %hash; my $lane =1; foreach my $aref (@lanes) { @hash{@$aref} = ($lane) x @$aref; $lane++; } my $vector = 210121; print $hash{$vector}; #prints 6