in reply to Problem with (recursively?) searching flat file database
will match everything if $line[3] is not defined.@results = grep( /^$line[3]/, @raw_data);
And even if $line[3] is defined, it's not going to do what you want. Let's say it holds "1". The regex will then match strings that start with "1", "12", "123", etc.
I suspect that you really want to do something like
@results = grep( (split(@_))[0] eq $line[3], @raw_data);
|
|---|