OO perl accessors for Thrift objects
Summary: Submitted by Jake Luciani
Reviewed By: cpiro
Test Plan: Supplied in test/tutorial code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665276 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tutorial/perl/PerlClient.pl b/tutorial/perl/PerlClient.pl
index 10cb725..44a5a52 100644
--- a/tutorial/perl/PerlClient.pl
+++ b/tutorial/perl/PerlClient.pl
@@ -31,14 +31,14 @@
print "ping()\n";
- my $sum = $client->add(1000000,1);
+ my $sum = $client->add(1,1);
print "1+1=$sum\n";
- my $work = new Work();
+ my $work = new tutorial::Work();
- $work->{op} = Operation::DIVIDE;
- $work->{num1} = 1;
- $work->{num2} = 0;
+ $work->op(Operation::DIVIDE);
+ $work->num1(1);
+ $work->num2(0);
eval {
$client->calculate(1, $work);
@@ -47,9 +47,9 @@
warn "InvalidOperation: ".Dumper($@);
}
- $work->{op} = Operation::SUBTRACT;
- $work->{num1} = 15;
- $work->{num2} = 10;
+ $work->op(Operation::SUBTRACT);
+ $work->num1(15);
+ $work->num2(10);
my $diff = $client->calculate(1, $work);
print "15-10=$diff\n";