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.
In reply to Re^3: JSON::Path and node iteration (updated)
by haukex
in thread JSON::Path and node iteration
by frazap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |