[open-ils-commits] r11655 - trunk/Open-ILS/src/perlmods/OpenILS/Application

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Dec 22 15:37:40 EST 2008


Author: erickson
Date: 2008-12-22 15:37:36 -0500 (Mon, 22 Dec 2008)
New Revision: 11655

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm
Log:
added strict/warnings and fixed some var handling.  also, make sure i capture the final result

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm	2008-12-22 20:36:32 UTC (rev 11654)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm	2008-12-22 20:37:36 UTC (rev 11655)
@@ -3,6 +3,7 @@
 package OpenILS::Application::PermaCrud;
 use OpenILS::Application;
 use base qw/OpenILS::Application/;
+use strict; use warnings;
 
 use Unicode::Normalize;
 use OpenSRF::EX qw/:try/;
@@ -71,10 +72,11 @@
     }
 
     my $class_node;
+    my $error = '';
     try {
         ($class_node) = $xpc->findnodes( "//idl:class[\@id='$self->{class_hint}']", $idl->documentElement );
     } catch Error with {
-        my $error = shift;
+        $error = shift;
         $log->error("Error finding class node: $error [//idl:class[\@id='$self->{class_hint}']]");
         throw OpenSRF::DomainObject::oilsException->new(
             statusCode => 500,
@@ -94,7 +96,7 @@
     try {
         ($action_node) = $xpc->findnodes( "perm:permacrud/perm:actions/perm:$self->{action}", $class_node );
     } catch Error with {
-        my $error = shift;
+        $error = shift;
         $log->error("Error finding action node: $error [perm:permacrud/perm:actions/perm:$self->{action}]");
         throw OpenSRF::DomainObject::oilsException->new(
             statusCode => 500,
@@ -190,7 +192,7 @@
 
     $o_type =~ s/\./_/og;
     my $method = $self->{action} . "_$o_type";
-    $e->$method($obj) or return $e->die_event;
+    my $val = $e->$method($obj) or return $e->die_event;
     $e->commit;
 
     return $val;



More information about the open-ils-commits mailing list