Question: Trying to make a simple program that open a webpage when executed but I'm getting a parse error, and I don't know why. 

```
#include <windows.h>
#include <shellapi.h>

bool open_browser()
{

    HINSTANCE result = ShellExecuteA( HWND, "open", "http://www.reddit.com", 
    NULL, NULL, SW_SHOWNORMAL );

    // Return whether or not we were successful.
    return (result);
}

int main( )
{
    open_browser();

    return 0;
}

```

Answer: 
You could transform the accepted return values into a hash

```
my %values = map { $_ => 1 } @acceptedValues;

```

And `grep` with the condition that the key exists instead of your
original grep:

```
my @allowed = grep $values{ $_->method }, @objects;

```

Anyway, `grep` is pretty fast in itself, and this is just an idea of a
common approach to checking if an element is in an array. Try not to
optimize what's not needed, since it would only be worth in really big
arrays. Then you could for example sort the accepted results array and
use a binary search, or cache results if they repeat. But again, don't
worry with this kind of optimisation unless you're dealing with hundreds
of thousands of items — or more.
Elements supposed to be present in given arrays seems unique. So, I will make a hash containing the count of elements from both arrays. If there is any element with count greater than 1, it means its present in both the arrays.  

```
my %values;
my @allowed;
map {$values{$_}++} (@acceptableValues, @objects);
for (keys %values) {
    push @allowed, $_ if $values{$_} > 1;
}

```