Thrift::IDL - Parser and OO representation of a Thrift interface definintion language (IDL)
my $idl = Thrift::IDL->parse_thrift_file('tutorial.thrift'); foreach my $service ($idl->services) { printf "Offers service '%s':\n", $service->name; }
The Thrift interface definition language (IDL) file is a structured file describing all the data types, services, methods, etc. of a Thrift interface. This is necessary if you need an in-memory representation of the Thrift schema.
my $document = Thrift::IDL->parse_thrift_file('tutorial.thrift');
Given a filename of a Thrift IDL file and an optional boolean for debug output, parse the input file into a Thrift::IDL::Document object and return it. The debug flag will cause verbose output on STDERR.
my $document = Thrift::IDL->parse_thrift(...);
Given a scalar of a Thrift IDL file and an optional boolean for debug output, parse the input into a Thrift::IDL::Document object and return it. The debug flag will cause verbose output on STDERR.
NOTE: If the thrift references other documents via an include statement, you'll need to use absolute paths
To install Thrift::Parser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Thrift::Parser
CPAN shell
perl -MCPAN -e shell install Thrift::Parser
For more information on module installation, please visit the detailed CPAN module installation guide.