sub foo { my $self = shift; my @args = @_; $self->{bar} = ref ( $_[0] ) ? $_[0] : \@args; }