# $obj->fooify(1,2,3) or fooify(10,20,30) # always expects 3 "real" args sub fooify { my $self; $self = shift if @_ == 4; # if 4 args, the first is the object/class my ($x, $y, $z) = @_; # ... } #### sub fooify { my $self; $self = shift if UNIVERSAL::isa($_[0], __PACKAGE__); my ($x, $y, $z) = @_; # ... }