"Internal Server Error" is not generated by perl. It sounds like the sort of thing a web server might spit out. Look in its logs for details.
I suspect that you have:
- a typo in your code; or
- you are using strict (like you should) and forgot a my; or
- you are trampling on a %states that is being used by some other piece of code
And no, %states is not reserved:
$ perl -Mstrict -Mwarnings -e 'my %states'
$