my $foo = attached($ref,'elements') || attach_var($ref,$something,'elements')