Syntactic Confectionery Delight | |
PerlMonks |
Re: Mail::Chimp3 Add Memberby 1nickt (Canon) |
on Jan 27, 2020 at 20:25 UTC ( [id://11111939]=note: print w/replies, xml ) | Need Help?? |
Hi, "object" there refers to a JSON object that the MailChimp server is expecting to receive as the value of the merge_fields param, not a Perl object. The module you are using handles converting your arguments to add_member into the right format for the HTTP call, but as Fletch said you are passing in a hash, which expands to a list, so merge_fields is getting as its value just the first key from your hash (and a bunch of other bogus params are being passed and presumably ignored). When you pass a reference to the hash instead it is a single data structure and the module will properly convert it to a JSON "object" when making the call to MailChimp. Hope this helps!
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom
|
|