in reply to Dereferencing my hash?

I take it you haven't got strictures (use warnings; use strict;) enabled.

Had you done so, you would probably have been able to tell that, in

my %cookie_hash = $IN->{cookies};
, you are attempting to assign a hash ref. to a hash (perlref)... try either
my %cookie_hash = %{ $IN->{cookies} };
or, the more usual,
my $cookie_hash = $IN->{cookies};
...

A user level that continues to overstate my experience :-))