my $cr = REST::Client::CrossRef->new( mailto => 'd...h', spit_raw_data => 0, add_end_flag => 1, json_path => [ ['$..author[*].[family,given,affiliation]'], ], json_path_callback => { '$..author[*].[family,given,affiliation]' => \&unfoldauthors4 }, ); sub unfoldauthors4 { my ($authors) = @_; my @all = @{$authors}; print Dumper @all; my $authors_limit = 50; my $last = $authors_limit - 1; my $size = @all / 3; if ( $size > $authors_limit ) { @all = @all[ 0 .. $last * 3 ]; $all[ $last * 3 - 1 ] .= " ..."; } my @res; my $i; for ( $i = 0; $i <= $#all; $i += 3 ) { my $line = $all[$i] . ", " . $all[ $i + 1 ] . "; " . join( " ", map { $_->{name} } @{ $all[ $i + 2 ] } ); push @res, $line; } return \@res; }