use HTTP::Tiny; use Clone qw(clone); my $http = HTTP::Tiny->new; my $headers = { 'headers' => { 'Authorization' => 'Bearer ' . $Site::Variables::stripe_secret, }, 'agent' => 'Wayfinder/v3.0', }; # for each API call my $head = clone($headers); my $response = $http->post_form($stripe_api_url, $payload, $head);