in reply to Re^2: JSON::Path and node iteration
in thread JSON::Path and node iteration
I think that my values are in the first element of the array because of the selector $.author here
Ah yes, I didn't play around with JSON::Path because I haven't used that yet (and it seemed like it might be a little overkill in this case). Anyway, I think then my unfoldauthors3 should do what you want? (Update: The same $data_ar = $data_ar->[0]; step will probably be necessary with $authors.)
Update 2: I took a look at the source of REST::Client::CrossRef, and it seems like that's the code that wraps the argument of the callback in an extra arrayref. In unfoldauthors3, you could probably just say @{$authors->[0]} instead of @$authors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: JSON::Path and node iteration (updated)
by frazap (Monk) on Mar 22, 2019 at 06:53 UTC | |
by hdb (Monsignor) on Mar 22, 2019 at 14:15 UTC | |
by frazap (Monk) on Mar 22, 2019 at 15:22 UTC |