When running the Thrift compiler for Perl the automatically generated code uses "Indirect Object Syntax". So the generated code looks like this:
It should look like this:
I found in some cases the indirect object syntax can actually cause failures because Perl gets confused and thinks Response is a subroutine, with an error like this:
If you look in https://perldoc.perl.org/perlobj.html under the "Indirect Object Syntax" heading, you see it says:
"Outside of the file handle case, use of this syntax is discouraged as it can confuse the Perl interpreter. See below for more details.".
Fixing this problem should be straight forward. In the https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_perl_generator.cc it should instead of doing this: