in reply to isolate a filed from within a spreadsheet
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: isolate a field from within a spreadsheet
by jonnyfolk (Vicar) on Nov 20, 2002 at 18:42 UTC |