foreach (sort keys %h) { @n = split /\t/, $h{$_}; map {say if $_ > $last+50; $last = $_} @n; }