in reply to Returning in a module

Try to use strict; in front of your module. If getAccessLog() returns the hashref, you need to use it like $log->{hits}. Also note, that you should prefer bless with two arguments.
Boris