my $attrs = ref eq 'HASH' ? $_ : {} for shift @$data;