package Err; sub new { return bless {@_}, shift; } sub err { my $self = shift; my %args = (%$self, @_); # Do something with %args here }