package Frontier::Daemon; sub new{ my $pkg = shift; # this would be Frontier::Daemon my %opts = @_; # these are the key/val pairs passed to you # $opts{LocalPort} # $opts{methods} # ... # and you can my $obj = \%opts; bless $obj, $pkg; return $obj; }