in reply to Re^2: Compare elements of a line in a file
in thread Compare elements of a line in a file

So, based on the code you posted in response to Dave, you should be able to replace your foreach loop with:
foreach (sort keys %h) { @n = split /\t/, $h{$_}; map {say if $_ > $last+50; $last = $_} @n; }

Replies are listed 'Best First'.
Re^4: Compare elements of a line in a file
by oxydeepu (Novice) on Sep 13, 2012 at 08:35 UTC

    Thank you.

    I will try that snippet.

Re^4: Compare elements of a line in a file
by oxydeepu (Novice) on Sep 13, 2012 at 08:38 UTC

    Thank you.

    I will try that snippet. If you don't mind can you tell me what does it do?

      Unless I've made a typo, the following two snippets should be equivalent:
      my $last = -50; # set to -50 so that the first coordinate will be incl +uded as long as it is 1 or more map {say if $_ > $last + 50; $last = $_} @n;
      my $last = -50; for (@n) { if ($_ > $last + 50) { say $_; } $last = $_; }

        Thanks a ton. I don't Know your name.
        Anyways it worked. Thank you.

        Best Regards
        Deepak