Or perhaps you mean that you want to compare the first field of the first line in the file against the first fields of all subsequent lines? In that case, perhaps something like (also untested):
... open file handles, etc. ...
defined(my $first_line = <RAW>) or die "reading raw input: $!";
chomp $first_line;
my ($first_line_first_field) = split m{ , \s* }xms, $first_line;
while (defined(my $following_line = <RAW>)) {
chomp $following_line;
my ($following_line_first_field) = split m{ , \s* }xms, $following
+_line;
compare($first_line_first_field, $following_line_first_field);
}
close RAW or die "closing raw handle: $!";
(Of course, you have to write the compare() function!)
Update: Added error check to original
my $first_line = <RAW>;
statement above to make it
defined(my $first_line = <RAW>) or die "reading raw input: $!";
Give a man a fish: <%-{-{-{-<
|