[Bio] / FigKernelPackages / ServerThing.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ServerThing.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34, Wed Dec 16 20:57:35 2009 UTC revision 1.35, Fri Jan 29 16:08:29 2010 UTC
# Line 199  Line 199 
199  sub GetIdList {  sub GetIdList {
200      # Get the parameters.      # Get the parameters.
201      my ($name, $args, $optional) = @_;      my ($name, $args, $optional) = @_;
202        # Declare the return variable.
203        my $retVal;
204      # Check the argument format.      # Check the argument format.
205      if (ref $args ne 'HASH') {      if (! defined $args && $optional) {
206            # Here there are no parameters, but the arguments are optional so it's
207            # okay.
208            $retVal = [];
209        } elsif (ref $args ne 'HASH') {
210            # Here we have an invalid parameter structure.
211          Confess("No '$name' parameter present.");          Confess("No '$name' parameter present.");
212      }      } else {
213      # Try to get the IDs from the argument structure.          # Here we have a hash with potential parameters in it. Try to get the
214      my $retVal = $args->{$name};          # IDs from the argument structure.
215            $retVal = $args->{$name};
216      # Was a member found?      # Was a member found?
217      if (! defined $retVal) {      if (! defined $retVal) {
218          # No. If we're optional, return an empty list; otherwise throw an error.          # No. If we're optional, return an empty list; otherwise throw an error.
# Line 214  Line 222 
222              Confess("No '$name' parameter found.");              Confess("No '$name' parameter found.");
223          }          }
224      } else {      } else {
225          # Here we found something. Get the parameter type. We was a list reference.              # Here we found something. Get the parameter type. We want a list reference.
226          # If it's a scalar, we'll convert it to a singleton list. If it's anything          # If it's a scalar, we'll convert it to a singleton list. If it's anything
227          # else, it's an error.          # else, it's an error.
228          my $type = ref $retVal;          my $type = ref $retVal;
# Line 224  Line 232 
232              Confess("The '$name' parameter must be a list.");              Confess("The '$name' parameter must be a list.");
233          }          }
234      }      }
235        }
236      # Return the result.      # Return the result.
237      return $retVal;      return $retVal;
238  }  }

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3