Question: Having some trouble adding some keys to a hash, i.e. modifying in a subroutine. Here's my subroutine call:

```
getMissingItems($filename, \%myItems); #myItems is already defined above this

```

and the subroutine itself:

```
sub getMissingItems {
    my $filename = shift;
    my $itemHash = shift;

    #... some stuff

    foreach $item (@someItems) {

        if (not exists $itemHash{$item}) {
            %$itemHash{$item} = 0; 
        }

    }

}

```

I get the error "Global symbol %itemHash requires explicit package name"

How should I be doing this properly? Thanks. 

EDIT - thanks everyone, over this first hurdle. I'm now getting "Can't use string ("0") as a HASH ref while "strict refs" in use." I just want to set the missing key entry to zero

Answer: 
You're not using the correct syntax for accessing elements of a hashref.

Try `$itemhash->{$item}` or `$$itemhash{$item}` in the innermost loop.
Your code has $itemHash{$item}, it should be $itemHash->{$item}. The code below points to the line with the error.

```
sub getMissingItems {
    my $filename = shift;
    my $itemHash = shift;

    foreach $item (@someItems) {

        if (not exists $itemHash{$item}) { # <--- this is wrong
            %$itemHash{$item} = 0; # <--- this one too
        }

    }
}

```