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