my $matched = ($_ eq substr "foobar",0,length);