no warnings qw /uninitialized/;

I guess you've put it specially to silence the exact warning that tells you where the error is. You're splitting on "\t", but looking onto your input I have the impression that there are no tabs. So $value in

next if $value > 500;
is probably uninitialized.

Update: well, after looking more closely I think real input contains tabs, but then it should work (to some extent). I think it is was a rather weird idea to keep coordinates in array like you did, e.g. you don't have 0 element, and some others may be missing. Here's a simplified version:

#!/usr/bin/perl use Modern::Perl; while (<DATA>) { chomp; my ($index, $value) = split /\s/; say "$index\t$value" if $value <= 500; } __DATA__ 1 10 2 11 3 9 4 500 5 550

Update: removed unused var


In reply to Re: outputing specific co-ordinates by zwon
in thread outputing specific co-ordinates by Taylorswift13

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.