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...' );

In reply to Re: Encountered object '5.03 ', but neither allow_blessed nor convert_blessed settings are enabled by Bod
in thread Encountered object '5.03 ', but neither allow_blessed nor convert_blessed settings are enabled by CropCircle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.