Verifying content in variables and data structures

I’m working with a script that communicates with an external API and then retrieves values back to RT, but I need a way to verify the content in my variables and data structures is correct so that I know what i’m sending the right values, and also to check the exact format in the response I get back from the external API so that I can work with that data in RT.

I’ve tried with ‘print’, with ‘bless’ and with ‘say’; but none of those options printed the value of my variables in the log

Here is a portion of the code i’m refering to, in this scenario I would like to print the value of my structure $rt_ticket in order to verify its content, much like I will have to do it with the response I get after decoding it from JSON back to Perl again.

my $rt_ticket = {
ticket => $ticket,
requestor => $email_address,
domain => $email_domain,
SLA => $SLA,
};

my $json = JSON->new();
my $ticket_json = $json->encode($rt_ticket);

Assuming you’ve looked here https://docs.bestpractical.com/rt/4.4.4/RT_Config.html#Logging and it’s no good for you, you could try a filehandle and punt your variables to the file. Bit messy, but you should get the data