sub _addbuf { my ($class, $buffer) = @_; my $args = shift @$buffer; if (SOMECLASS->exists($args->{parent}) { my $new = SOMECLASS->new($args); } else { push(@$buffer, $args); } #SOMECLASS->_addbuf($buffer); }