my ($self) = @_; # You should probably write: my ($self) = shift; # Option 1. my ($self) = $_[0]; # Option 2. The two options do a very similar thing, choose the one that suits you and make sure you understand what they mean.