sub foo { my $self=shift; if (@_==1) { // do something with single arg } elsif (@_==2) { // do something with two args } } #### foo(@bar);