sub ref_push { if (ref $_[0] eq "ARRAY") { push @{$_[0]}, @_[1..$#_]; } elsif (ref $_[0]) { warn "Cannot push onto non-ARRAY ref"; } elsif (!defined $_[0]) { $_[0] = [ @_[1..$#_] ]; else { warn "Cannot push: Variable already defined as something else"; } } # ref_push