So, building off a question about string matching (this thread), I am working on implementing that info in solution 3 into a working solution to the problem I am working on.
However, I am getting errors, specifically about this line of the below function:
next if @$args->{search_in} !~ /@$cur[1]/;
syntax error at ./db_index.pl line 16, near "next "
My question as a perl newbie is what am I doing wrong here?
sub search_for_key
{
my ($args) = @_;
foreach $row(@{$args->{search_ary}}){
print "@$row[0] : @$row[1]\n";
}
my $thiskey = NULL;
foreach $cur (@{$args->{search_ary}}){
print "\n" . @$cur[1] . "\n"
next if @$args->{search_in} !~ /@$cur[1]/;
$thiskey = @$cur[0];
last;
}
return $thiskey;
}