[ale] Perl Question

Fletch fletch at phydeaux.org
Fri Jul 30 13:02:39 EDT 2004


You might look at Class::DBI before reimpleminting the wheel.


At any rate, yes it's quite feasable to pass key => value params, then
in your sub do something along the lines of:


sub foozle {
  my %defaults = ( wonkle => 'zorbnats',
                   fleegle => 'wubba wubba', );
  my %args = ( %defaults, @_ );

  if( exists $args{ optional } ) {
    ## ...
  }

  print "fleegle: ", $args{ fleegle }, "\n";
}


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U



More information about the Ale mailing list