Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Encountered object '5.03 ', but neither allow_blessed nor convert_blessed settings are enabled

by Bod (Parson)
on Jun 20, 2024 at 18:20 UTC ( [id://11160136]=note: print w/replies, xml ) Need Help??


in reply to Encountered object '5.03 ', but neither allow_blessed nor convert_blessed settings are enabled

I'm getting a very similar error...

my $payload = { 'sender' => { 'name' => $vars{'fromname'}, 'email' => $vars{'frommail'}, }, 'to' => [{ 'name' => $vars{'name'}, 'email' => $vars{'email'}, }], 'subject' => $vars{'subject'}, 'HTMLcontent' => $body, }; $payload->{'textContent'} = $vars{'preview'} if $vars{'preview'}; my $attrs = { 'headers' => $headers, 'content' => encode_json $payload, };

This is part of the email module we use to send emails through Brevo. But I'm seeing an error...

encountered object 'Site::Email=HASH(0x55fa0a139c18)', but neither all +ow_blessed, convert_blessed nor allow_tags settings are enabled (or T +O_JSON/FREEZE method missing)

The error line is encode_json.

The weird part is that nearly identical code is running elsewhere on the same server without a problem! It's been suggested that bignum could affect it but we are not using that module in either place.

I'm aware of this bug report but that wouldn't explain why one place fails and another doesn't.

Dumpling $payload gives the result one would expect - any ideas on how I further debug this issue?

This is Perl v5.36 on Debian 12

UPDATE...

The problem turned out to be the way I was calling the module...and using the same variable twice!

my $email = Site::Email->new; my $resp = $email->send( 'fname' => $fname, 'user' => "$prefix$data{'idCRM'}", 'token' => $token, 'template' => 'newuser', 'name' => $to, 'email' => $email, 'subject' => 'Your Book Boost Account...' );
  • Comment on Re: Encountered object '5.03 ', but neither allow_blessed nor convert_blessed settings are enabled
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11160136]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2026-04-16 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.