in reply to Re^3: JSON::Path and node iteration (updated)
in thread JSON::Path and node iteration
does it.sub unfoldauthors3 { my ($authors) = @_; return [ map { $_->{family}.', '.$_->{given}.'; '.join(' - ', map {$_->{name}} @{ $_->{affiliation} }) } @{$authors->[0]} ]; }
And I agree that my original unfoldauthors using JSON::Path is overkilling.
My original question should have been reworded as:
If I wanted to use JSON::Path instead of ripping the perl data directly could I have the same output in one extraction, in one loop ?
In the unfoldauthors above I have to use the JSON::Path object for the affiliation name for each author's name.
Is there a way using JSON::Path to have in the same time, the author's family, given, affiliation.name ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: JSON::Path and node iteration (updated)
by hdb (Monsignor) on Mar 22, 2019 at 14:15 UTC | |
by frazap (Monk) on Mar 22, 2019 at 15:22 UTC |