in reply to Stuck on a Perl assignment

You are passing addtwo() an array reference (the square brackets []), but treating it like a hash reference (by using $params->{structure}). You might need to read up on perlref.