[Opensrf-commits] r1406 - trunk/src/perlmods/OpenSRF

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Aug 9 23:53:30 EDT 2008


Author: miker
Date: 2008-08-09 23:53:28 -0400 (Sat, 09 Aug 2008)
New Revision: 1406

Modified:
   trunk/src/perlmods/OpenSRF/Application.pm
Log:
allow methods do decide on their strictness; properly parse params text signatures

Modified: trunk/src/perlmods/OpenSRF/Application.pm
===================================================================
--- trunk/src/perlmods/OpenSRF/Application.pm	2008-08-08 22:26:54 UTC (rev 1405)
+++ trunk/src/perlmods/OpenSRF/Application.pm	2008-08-10 03:53:28 UTC (rev 1406)
@@ -42,6 +42,12 @@
 	return $self->{argc};
 }
 
+sub strict {
+	my $self = shift;
+	return 0 unless ref($self);
+	return $self->{strict};
+}
+
 sub api_name {
 	my $self = shift;
 	return 1 unless ref($self);
@@ -147,8 +153,7 @@
 
 			my $resp;
 			try {
-				# un-if(0) this block to enable param checking based on signature and argc
-				if (0) {
+				if ($coderef->strict) {
 					if (@args < $coderef->argc) {
 						die	"Not enough params passed to ".
 							$coderef->api_name." : requires ". $coderef->argc
@@ -327,7 +332,7 @@
 sub parse_string_signature {
 	my $string = shift;
 	return [] unless $string;
-	my @chunks = split(/\@/so, $string);
+	my @chunks = split(/\@/sog, $string);
 
 	my @params;
 	my $ret;



More information about the opensrf-commits mailing list