diff --git a/test/perl/TestClient.pl b/test/perl/TestClient.pl
index 990274c..96e3bec 100755
--- a/test/perl/TestClient.pl
+++ b/test/perl/TestClient.pl
@@ -45,7 +45,7 @@
 $|++;
 
 sub usage {
-    print <<EOF;
+    print <<"EOF";
 Usage: $0 [OPTIONS]
 
 Options:                          (default)
@@ -91,20 +91,24 @@
 }
 
 my $socket = undef;
-if ($opts{"domain-socket"}) {
-    $socket = new Thrift::UnixSocket($opts{"domain-socket"});
-} elsif ($opts{ssl}) {
-  $socket = new Thrift::SSLSocket(\%opts);
-} else {
-  $socket = new Thrift::Socket($opts{host}, $opts{port});
+if ($opts{'domain-socket'}) {
+    $socket = Thrift::UnixSocket->new($opts{'domain-socket'});
+}
+elsif ($opts{ssl}) {
+  $socket = Thrift::SSLSocket->new(\%opts);
+}
+else {
+  $socket = Thrift::Socket->new($opts{host}, $opts{port});
 }
 
 my $transport;
 if ($opts{transport} eq 'buffered') {
-    $transport = new Thrift::BufferedTransport($socket, 1024, 1024);
-} elsif ($opts{transport} eq 'framed') {
-    $transport = new Thrift::FramedTransport($socket);
-} else {
+    $transport = Thrift::BufferedTransport->new($socket, 1024, 1024);
+}
+elsif ($opts{transport} eq 'framed') {
+    $transport = Thrift::FramedTransport->new($socket);
+}
+else {
     usage();
     exit 1;
 }
@@ -112,20 +116,21 @@
 my $protocol;
 my $protocol2;
 if ($opts{protocol} eq 'binary' || $opts{protocol} eq 'multi') {
-    $protocol = new Thrift::BinaryProtocol($transport);
-} else {
+    $protocol = Thrift::BinaryProtocol->new($transport);
+}
+else {
     usage();
     exit 1;
 }
 
 my $secondService = undef;
 if (index($opts{protocol}, 'multi') == 0) {
-  $protocol2 = new Thrift::MultiplexedProtocol($protocol, "SecondService");
-  $protocol = new Thrift::MultiplexedProtocol($protocol, "ThriftTest");
-  $secondService = new ThriftTest::SecondServiceClient($protocol2);
+  $protocol2     = Thrift::MultiplexedProtocol->new($protocol, 'SecondService');
+  $protocol      = Thrift::MultiplexedProtocol->new($protocol, 'ThriftTest');
+  $secondService = ThriftTest::SecondServiceClient->new($protocol2);
 }
 
-my $testClient = new ThriftTest::ThriftTestClient($protocol);
+my $testClient = ThriftTest::ThriftTestClient->new($protocol);
 
 eval {
   $transport->open();
@@ -146,52 +151,52 @@
 #
 # VOID TEST
 #
-print("testVoid()");
+print('testVoid()');
 $testClient->testVoid();
 print(" = void\n");
 
 #
 # STRING TEST
 #
-print("testString(\"Test\")");
-my $s = $testClient->testString("Test");
-print(" = \"$s\"\n");
+print('testString("Test")');
+my $s = $testClient->testString('Test');
+print(qq| = "$s"\n|);
 exit(ERR_BASETYPES) if ($s ne 'Test');
 
 #
 # MULTIPLEXED TEST
 #
 if (index($opts{protocol}, 'multi') == 0) {
-    print("secondtestString(\"Test2\")");
-    $s = $secondService->secondtestString("Test2");
-    print(" = \"$s\"\n");
+    print('secondtestString("Test2")');
+    $s = $secondService->secondtestString('Test2');
+    print(qq| = "$s"\n|);
     exit(ERR_PROTOCOL) if ($s ne 'testString("Test2")');
 }
 
 #
 # BOOL TEST
 #
-print("testBool(1)");
+print('testBool(1)');
 my $t = $testClient->testBool(1);
 print(" = $t\n");
 exit(ERR_BASETYPES) if ($t ne 1);
-print("testBool(0)");
+print('testBool(0)');
 my $f = $testClient->testBool(0);
 print(" = $f\n");
-exit(ERR_BASETYPES) if ($f ne "");
+exit(ERR_BASETYPES) if ($f ne q||);
 
 
 #
 # BYTE TEST
 #
-print("testByte(1)");
+print('testByte(1)');
 my $u8 = $testClient->testByte(1);
 print(" = $u8\n");
 
 #
 # I32 TEST
 #
-print("testI32(-1)");
+print('testI32(-1)');
 my $i32 = $testClient->testI32(-1);
 print(" = $i32\n");
 exit(ERR_BASETYPES) if ($i32 ne -1);
@@ -199,7 +204,7 @@
 #
 # I64 TEST
 #
-print("testI64(-34359738368)");
+print('testI64(-34359738368)');
 my $i64 = $testClient->testI64(-34359738368);
 print(" = $i64\n");
 exit(ERR_BASETYPES) if ($i64 ne -34359738368);
@@ -207,7 +212,7 @@
 #
 # DOUBLE TEST
 #
-print("testDouble(-852.234234234)");
+print('testDouble(-852.234234234)');
 my $dub = $testClient->testDouble(-852.234234234);
 print(" = $dub\n");
 exit(ERR_BASETYPES) if ($dub ne -852.234234234);
@@ -220,33 +225,33 @@
 #
 # STRUCT TEST
 #
-print("testStruct({\"Zero\", 1, -3, -5})");
-my $out = new ThriftTest::Xtruct();
-$out->string_thing("Zero");
+print('testStruct({"Zero", 1, -3, -5})');
+my $out = ThriftTest::Xtruct->new();
+$out->string_thing('Zero');
 $out->byte_thing(1);
 $out->i32_thing(-3);
 $out->i64_thing(-5);
 my $in = $testClient->testStruct($out);
-print(" = {\"".$in->string_thing."\", ".
-        $in->byte_thing.", ".
-        $in->i32_thing.", ".
+print(' = {"'.$in->string_thing.'", '.
+        $in->byte_thing.', '.
+        $in->i32_thing.', '.
         $in->i64_thing."}\n");
 
 #
 # NESTED STRUCT TEST
 #
-print("testNest({1, {\"Zero\", 1, -3, -5}, 5}");
-my $out2 = new ThriftTest::Xtruct2();
+print('testNest({1, {"Zero", 1, -3, -5}, 5}');
+my $out2 = ThriftTest::Xtruct2->new();
 $out2->byte_thing(1);
 $out2->struct_thing($out);
 $out2->i32_thing(5);
 my $in2 = $testClient->testNest($out2);
 $in = $in2->struct_thing;
-print(" = {".$in2->byte_thing.", {\"".
-      $in->string_thing."\", ".
-      $in->byte_thing.", ".
-      $in->i32_thing.", ".
-      $in->i64_thing."}, ".
+print(' = {'.$in2->byte_thing.', {"'.
+      $in->string_thing.'", '.
+      $in->byte_thing.', '.
+      $in->i32_thing.', '.
+      $in->i64_thing.'}, '.
       $in2->i32_thing."}\n");
 
 #
@@ -256,28 +261,30 @@
 for (my $i = 0; $i < 5; ++$i) {
   $mapout->{$i} = $i-10;
 }
-print("testMap({");
+print('testMap({');
 my $first = 1;
 while( my($key,$val) = each %$mapout) {
     if ($first) {
         $first = 0;
-    } else {
-        print(", ");
+    }
+    else {
+        print(', ');
     }
     print("$key => $val");
 }
-print("})");
+print('})');
 
 
 my $mapin = $testClient->testMap($mapout);
-print(" = {");
+print(' = {');
 
 $first = 1;
 while( my($key,$val) = each %$mapin){
     if ($first) {
         $first = 0;
-    } else {
-        print(", ");
+    }
+    else {
+        print(', ');
     }
     print("$key => $val");
 }
@@ -291,11 +298,11 @@
     push(@$setout, $i);
 }
 
-print("testSet({".join(",",@$setout)."})");
+print('testSet({'.join(',',@$setout).'})');
 
 my $setin = $testClient->testSet($setout);
 
-print(" = {".join(",",@$setout)."}\n");
+print(' = {'.join(',',@$setout)."}\n");
 
 #
 # LIST TEST
@@ -305,111 +312,111 @@
     push(@$listout, $i);
 }
 
-print("testList({".join(",",@$listout)."})");
+print('testList({'.join(',',@$listout).'})');
 
 my $listin = $testClient->testList($listout);
 
-print(" = {".join(",",@$listin)."}\n");
+print(' = {'.join(',',@$listin)."}\n");
 
 #
 # ENUM TEST
 #
-print("testEnum(ONE)");
+print('testEnum(ONE)');
 my $ret = $testClient->testEnum(ThriftTest::Numberz::ONE);
 print(" = $ret\n");
 
-print("testEnum(TWO)");
+print('testEnum(TWO)');
 $ret = $testClient->testEnum(ThriftTest::Numberz::TWO);
 print(" = $ret\n");
 
-print("testEnum(THREE)");
+print('testEnum(THREE)');
 $ret = $testClient->testEnum(ThriftTest::Numberz::THREE);
 print(" = $ret\n");
 
-print("testEnum(FIVE)");
+print('testEnum(FIVE)');
 $ret = $testClient->testEnum(ThriftTest::Numberz::FIVE);
 print(" = $ret\n");
 
-print("testEnum(EIGHT)");
+print('testEnum(EIGHT)');
 $ret = $testClient->testEnum(ThriftTest::Numberz::EIGHT);
 print(" = $ret\n");
 
 #
 # TYPEDEF TEST
 #
-print("testTypedef(309858235082523)");
+print('testTypedef(309858235082523)');
 my $uid = $testClient->testTypedef(309858235082523);
 print(" = $uid\n");
 
 #
 # NESTED MAP TEST
 #
-print("testMapMap(1)");
+print('testMapMap(1)');
 my $mm = $testClient->testMapMap(1);
-print(" = {");
+print(' = {');
 while( my ($key,$val) = each %$mm) {
     print("$key => {");
     while( my($k2,$v2) = each %$val) {
         print("$k2 => $v2, ");
     }
-    print("}, ");
+    print('}, ');
 }
 print("}\n");
 
 #
 # INSANITY TEST
 #
-my $insane = new ThriftTest::Insanity();
+my $insane = ThriftTest::Insanity->new();
 $insane->{userMap}->{ThriftTest::Numberz::FIVE} = 5000;
-my $truck = new ThriftTest::Xtruct();
-$truck->string_thing("Hello2");
+my $truck = ThriftTest::Xtruct->new();
+$truck->string_thing('Hello2');
 $truck->byte_thing(2);
 $truck->i32_thing(2);
 $truck->i64_thing(2);
-my $truck2 = new ThriftTest::Xtruct();
-$truck2->string_thing("Goodbye4");
+my $truck2 = ThriftTest::Xtruct->new();
+$truck2->string_thing('Goodbye4');
 $truck2->byte_thing(4);
 $truck2->i32_thing(4);
 $truck2->i64_thing(4);
 push(@{$insane->{xtructs}}, $truck);
 push(@{$insane->{xtructs}}, $truck2);
 
-print("testInsanity()");
+print('testInsanity()');
 my $whoa = $testClient->testInsanity($insane);
-print(" = {");
+print(' = {');
 while( my ($key,$val) = each %$whoa) {
     print("$key => {");
     while( my($k2,$v2) = each %$val) {
         print("$k2 => {");
         my $userMap = $v2->{userMap};
-        print("{");
-        if (ref($userMap) eq "HASH") {
+        print('{');
+        if (ref($userMap) eq 'HASH') {
             while( my($k3,$v3) = each %$userMap) {
                 print("$k3 => $v3, ");
             }
         }
-        print("}, ");
+        print('}, ');
 
         my $xtructs = $v2->{xtructs};
-        print("{");
-        if (ref($xtructs) eq "ARRAY") {
+        print('{');
+        if (ref($xtructs) eq 'ARRAY') {
             foreach my $x (@$xtructs) {
-                print("{\"".$x->{string_thing}."\", ".
-                      $x->{byte_thing}.", ".$x->{i32_thing}.", ".$x->{i64_thing}."}, ");
+                print('{"'.$x->{string_thing}.'", '.
+                      $x->{byte_thing}.', '.$x->{i32_thing}.', '.$x->{i64_thing}.'}, ');
             }
         }
-        print("}");
+        print('}');
 
-        print("}, ");
+        print('}, ');
     }
-    print("}, ");
+    print('}, ');
 }
 print("}\n");
 
 #
 # EXCEPTION TEST
 #
-print("testException('Xception')");
+print(q|testException('Xception')|);
 eval {
     $testClient->testException('Xception');
     print("  void\nFAILURE\n");
@@ -422,7 +429,7 @@
 # Normal tests done.
 #
 my $stop = gettimeofday();
-my $elp  = sprintf("%d",1000*($stop - $start), 0);
+my $elp  = sprintf('%d',1000*($stop - $start), 0);
 print("Total time: $elp ms\n");
 
 #
diff --git a/test/perl/TestServer.pl b/test/perl/TestServer.pl
index e8c1cfa..d2b9a38 100644
--- a/test/perl/TestServer.pl
+++ b/test/perl/TestServer.pl
@@ -27,7 +27,7 @@
 use Time::HiRes qw(gettimeofday);
 
 $SIG{INT} = \&sigint_handler;
- 
+
 use lib '../../lib/perl/lib';
 use lib 'gen-perl';
 
@@ -48,7 +48,7 @@
 $|++;
 
 sub usage {
-    print <<EOF;
+    print <<"EOF";
 Usage: $0 [OPTIONS]
 
 Options:                          (default)
@@ -99,54 +99,60 @@
     exit 1;
 }
 
-my $handler = new ThriftTestHandler();
-my $handler2 = new SecondServiceHandler();
-my $processor = new ThriftTest::ThriftTestProcessor($handler);
-my $processor2 = new ThriftTest::SecondServiceProcessor($handler2);
+my $handler    = ThriftTestHandler->new();
+my $handler2   = SecondServiceHandler->new();
+my $processor  = ThriftTest::ThriftTestProcessor->new($handler);
+my $processor2 = ThriftTest::SecondServiceProcessor->new($handler2);
+
 my $serversocket;
-if ($opts{"domain-socket"}) {
-    unlink($opts{"domain-socket"});
-    $serversocket = new Thrift::UnixServerSocket($opts{"domain-socket"});
-} elsif ($opts{ssl}) {
-    $serversocket = new Thrift::SSLServerSocket(\%opts);
-} else {
-    $serversocket = new Thrift::ServerSocket(\%opts);
+if ($opts{'domain-socket'}) {
+    unlink($opts{'domain-socket'});
+    $serversocket = Thrift::UnixServerSocket->new($opts{'domain-socket'});
+}
+elsif ($opts{ssl}) {
+    $serversocket = Thrift::SSLServerSocket->new(\%opts);
+}
+else {
+    $serversocket = Thrift::ServerSocket->new(\%opts);
 }
 my $transport;
 if ($opts{transport} eq 'buffered') {
-    $transport = new Thrift::BufferedTransportFactory();
-} elsif ($opts{transport} eq 'framed') {
-    $transport = new Thrift::FramedTransportFactory();
-} else {
+    $transport = Thrift::BufferedTransportFactory->new();
+}
+elsif ($opts{transport} eq 'framed') {
+    $transport = Thrift::FramedTransportFactory->new();
+}
+else {
     usage();
     exit 1;
 }
 my $protocol;
 if ($opts{protocol} eq 'binary' || $opts{protocol} eq 'multi') {
-    $protocol = new Thrift::BinaryProtocolFactory();
-} else {
+    $protocol = Thrift::BinaryProtocolFactory->new();
+}
+else {
     usage();
     exit 1;
 }
 
 if (index($opts{protocol}, 'multi') == 0) {
-  my $newProcessor = new Thrift::MultiplexedProcessor($protocol);
+  my $newProcessor = Thrift::MultiplexedProcessor->new($protocol);
   $newProcessor->defaultProcessor($processor);
-  $newProcessor->registerProcessor("ThriftTest", $processor);
-  $newProcessor->registerProcessor("SecondService", $processor2);
+  $newProcessor->registerProcessor('ThriftTest', $processor);
+  $newProcessor->registerProcessor('SecondService', $processor2);
   $processor = $newProcessor;
 }
 
 my $ssltag = '';
 if ($opts{ssl}) {
-    $ssltag = "(SSL)";
+    $ssltag = '(SSL)';
 }
 my $listening_on = "$opts{port} $ssltag";
-if ($opts{"domain-socket"}) {
-    $listening_on = $opts{"domain-socket"};
+if ($opts{'domain-socket'}) {
+    $listening_on = $opts{'domain-socket'};
 }
-my $server = new Thrift::SimpleServer($processor, $serversocket, $transport, $protocol);
-print "Starting \"simple\" server ($opts{transport}/$opts{protocol}) listen on: $listening_on\n";
+my $server = Thrift::SimpleServer->new($processor, $serversocket, $transport, $protocol);
+print qq|Starting "simple" server ($opts{transport}/$opts{protocol}) listen on: $listening_on\n|;
 $server->serve();
 print "done.\n";
 
@@ -169,70 +175,67 @@
     return bless($self, $classname);
 }
 
-sub testVoid() {
+sub testVoid {
   print("testVoid()\n");
 }
 
-sub testString() {
+sub testString {
   my $self = shift;
   my $thing = shift;
   print("testString($thing)\n");
   return $thing;
 }
 
-sub testBool() {
+sub testBool {
   my $self = shift;
   my $thing = shift;
-  my $str = $thing ? "true" : "false";
+  my $str = $thing ? 'true' : 'false';
   print("testBool($str)\n");
   return $thing;
 }
 
-sub testByte() {
+sub testByte {
   my $self = shift;
   my $thing = shift;
   print("testByte($thing)\n");
   return $thing;
 }
 
-sub testI32() {
+sub testI32 {
   my $self = shift;
   my $thing = shift;
   print("testI32($thing)\n");
   return $thing;
 }
 
-sub testI64() {
+sub testI64 {
   my $self = shift;
   my $thing = shift;
   print("testI64($thing)\n");
   return $thing;
 }
 
-sub testDouble() {
+sub testDouble {
   my $self = shift;
   my $thing = shift;
   print("testDouble($thing)\n");
   return $thing;
 }
 
-sub testBinary() {
+sub testBinary {
     my $self = shift;
     my $thing = shift;
     my @bytes = split //, $thing;
-    print("testBinary(");
-    foreach (@bytes)
-    {
-        printf "%02lx", ord $_;
-    }
-    print(")\n");
+    print 'testBinary(';
+    printf( '%02lx', ord $_ ) foreach (@bytes);
+    print ")\n";
     return $thing;
 }
 
-sub testStruct() {
+sub testStruct {
   my $self = shift;
   my $thing = shift;
-  printf("testStruct({\"%s\", %d, %d, %lld})\n",
+  printf(qq|testStruct({"%s", %d, %d, %lld})\n|,
            $thing->{string_thing},
            $thing->{byte_thing},
            $thing->{i32_thing},
@@ -240,11 +243,11 @@
   return $thing;
 }
 
-sub testNest() {
+sub testNest {
   my $self = shift;
   my $nest = shift;
   my $thing = $nest->{struct_thing};
-  printf("testNest({%d, {\"%s\", %d, %d, %lld}, %d})\n",
+  printf(qq|testNest({%d, {"%s", %d, %d, %lld}, %d})\n|,
            $nest->{byte_thing},
            $thing->{string_thing},
            $thing->{byte_thing},
@@ -254,92 +257,58 @@
   return $nest;
 }
 
-sub testMap() {
+sub testMap {
   my $self = shift;
   my $thing = shift;
-  print("testMap({");
-  my $first = 1;
-  foreach my $key (keys %$thing) {
-    if ($first) {
-        $first = 0;
-    } else {
-        print(", ");
-    }
-    print("$key => $thing->{$key}");
-  }
-  print("})\n");
+  printf "testMap({%s})\n",
+    join( ', ',
+          map { $_ . ' => ' . $thing->{$_} }
+          sort keys %$thing
+    );
   return $thing;
 }
 
-sub testStringMap() {
+sub testStringMap {
   my $self = shift;
   my $thing = shift;
-  print("testStringMap({");
-  my $first = 1;
-  foreach my $key (keys %$thing) {
-    if ($first) {
-        $first = 0;
-    } else {
-        print(", ");
-    }
-    print("$key => $thing->{$key}");
-  }
-  print("})\n");
+  printf "testStringMap({%s})\n",
+    join( ', ',
+          map { $_ . ' => ' . $thing->{$_} }
+          sort keys %$thing
+    );
   return $thing;
 }
 
-sub testSet() {
+sub testSet {
   my $self = shift;
   my $thing = shift;
-  my @arr;
-  my $result = \@arr;
-  print("testSet({");
-  my $first = 1;
-  foreach my $key (keys %$thing) {
-    if ($first) {
-        $first = 0;
-    } else {
-        print(", ");
-    }
-    print("$key");
-    push(@arr, $key);
-  }
-  print("})\n");
-  return $result;
+  my @result = sort keys %$thing;
+  printf "testSet({%s})\n", join(', ', @result );
+  return \@result;
 }
 
-sub testList() {
+sub testList {
   my $self = shift;
   my $thing = shift;
-  print("testList({");
-  my $first = 1;
-  foreach my $key (@$thing) {
-    if ($first) {
-        $first = 0;
-    } else {
-        print(", ");
-    }
-    print("$key");
-  }
-  print("})\n");
+  print "testList({%s})\n", join(', ', @$thing);
   return $thing;
 }
 
-sub testEnum() {
+sub testEnum {
   my $self = shift;
   my $thing = shift;
-  print("testEnum($thing)\n");
+  print "testEnum($thing)\n";
   return $thing;
 }
 
-sub testTypedef() {
+sub testTypedef {
   my $self = shift;
   my $thing = shift;
   print("testTypedef($thing)\n");
   return $thing;
 }
 
-sub testMapMap() {
+sub testMapMap {
   my $self = shift;
   my $hello = shift;
 
@@ -348,25 +317,25 @@
   return $result;
 }
 
-sub testInsanity() {
+sub testInsanity {
   my $self = shift;
   my $argument = shift;
   print("testInsanity()\n");
 
-  my $hello = new ThriftTest::Xtruct({string_thing => "Hello2", byte_thing => 2, i32_thing => 2, i64_thing => 2});
+  my $hello = ThriftTest::Xtruct->new({string_thing => 'Hello2', byte_thing => 2, i32_thing => 2, i64_thing => 2});
   my @hellos;
   push(@hellos, $hello);
-  my $goodbye = new ThriftTest::Xtruct({string_thing => "Goodbye4", byte_thing => 4, i32_thing => 4, i64_thing => 4});
+  my $goodbye = ThriftTest::Xtruct->new({string_thing => 'Goodbye4', byte_thing => 4, i32_thing => 4, i64_thing => 4});
   my @goodbyes;
   push(@goodbyes, $goodbye);
-  my $crazy = new ThriftTest::Insanity({userMap => { ThriftTest::Numberz::EIGHT => 8 }, xtructs => \@goodbyes});
-  my $loony = new ThriftTest::Insanity();
+  my $crazy = ThriftTest::Insanity->new({userMap => { ThriftTest::Numberz::EIGHT => 8 }, xtructs => \@goodbyes});
+  my $loony = ThriftTest::Insanity->new();
   my $result = { 1 => { ThriftTest::Numberz::TWO => $argument, ThriftTest::Numberz::THREE => $argument },
                  2 => { ThriftTest::Numberz::SIX => $loony } };
   return $result;
 }
 
-sub testMulti() {
+sub testMulti {
   my $self = shift;
   my $arg0 = shift;
   my $arg1 = shift;
@@ -376,39 +345,43 @@
   my $arg5 = shift;
 
   print("testMulti()\n");
-  return new ThriftTest::Xtruct({string_thing => "Hello2", byte_thing => $arg0, i32_thing => $arg1, i64_thing => $arg2});
+  return ThriftTest::Xtruct->new({string_thing => 'Hello2', byte_thing => $arg0, i32_thing => $arg1, i64_thing => $arg2});
 }
 
-sub testException() {
+sub testException {
   my $self = shift;
   my $arg = shift;
   print("testException($arg)\n");
-  if ($arg eq "Xception") {
-    die new ThriftTest::Xception({errorCode => 1001, message => $arg});
-  } elsif ($arg eq "TException") {
-    die "astring"; # all unhandled exceptions become TExceptions
-  } else {
-    return new ThriftTest::Xtruct({string_thing => $arg});
+  if ($arg eq 'Xception') {
+      die ThriftTest::Xception->new({errorCode => 1001, message => $arg});
+  }
+  elsif ($arg eq 'TException') {
+      die 'astring'; # all unhandled exceptions become TExceptions
+  }
+  else {
+      return ThriftTest::Xtruct->new({string_thing => $arg});
   }
 }
 
-sub testMultiException() {
+sub testMultiException {
   my $self = shift;
   my $arg0 = shift;
   my $arg1 = shift;
 
   printf("testMultiException(%s, %s)\n", $arg0, $arg1);
-  if ($arg0 eq "Xception") {
-    die new ThriftTest::Xception({errorCode => 1001, message => "This is an Xception"});
-  } elsif ($arg0 eq "Xception2") {
-    my $struct_thing = new ThriftTest::Xtruct({string_thing => "This is an Xception2"});
-    die new ThriftTest::Xception2({errorCode => 2002, struct_thing => $struct_thing});
-  } else {
-    return new ThriftTest::Xtruct({string_thing => $arg1});
+  if ($arg0 eq 'Xception') {
+    die ThriftTest::Xception->new({errorCode => 1001, message => 'This is an Xception'});
+  }
+  elsif ($arg0 eq 'Xception2') {
+    my $struct_thing = ThriftTest::Xtruct->new({string_thing => 'This is an Xception2'});
+    die ThriftTest::Xception2->new({errorCode => 2002, struct_thing => $struct_thing});
+  }
+  else {
+    return ThriftTest::Xtruct->new({string_thing => $arg1});
   }
 }
 
-sub testOneway() {
+sub testOneway {
   my $self = shift;
   my $num = shift;
   print("testOneway($num): received\n");
@@ -428,11 +401,11 @@
     return bless($self, $classname);
 }
 
-sub secondtestString() {
+sub secondtestString {
   my $self = shift;
   my $thing = shift;
   print("testString($thing)\n");
-  return "testString(\"" . $thing . "\")";
+  return qq|testString("$thing")|;
 }
 
 1;
