## presume @row has the current (main) row and we're adding value as last column ## replace with (e.g.) splice or whatever as appropriate for my $value ( @{ $values_for_id{ $id } // [ "-" ] } ) { say join( qq{\t}, @row, $value ); }