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