Is this a stealth CGI question? Including this:
my $checkthree = param('check');

would tend to indicate that it is.

You really should tell people, it is often highly relevant, albeit I think not in this case.

You really, really should start your scripts by enabling warnings and strictures. It may seem like a lot of work, but in the long run it will pay you back in saved time a thousandfold.

use strict; use warnings; my $checkthree = param('check');

You shouldn't use the filehandle DATA. DATA is a special filehandle for reading in data embedded in your script after the __END__ tag.

open IN, $data or die "Cannot open $data for reading:$!\n";

There seems to be no need to read the data file into an array since you are only looping through it once. Use a while loop instead. Don't define variables that you don't use when splitting up the line.

while (my $line =<DATA>) { my (undef,undef,$three,$four,undef) = split "\t",$line; if ($three eq $checkthree) {print "$three found before $four in li +ne $.\n"; last;} } close DATA;

--
Regards,
Helgi Briem
helgi AT decode DOT is


In reply to Re: isolate a filed from within a spreadsheet by helgi
in thread isolate a filed from within a spreadsheet by jonnyfolk

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.