moved ethnicity fixing out of moremember.pl into a function,

eventually to replace with a more configurable version (non-NZ specific)
This commit is contained in:
pate 2002-04-15 16:15:38 +00:00
parent e1d7a81197
commit 2409d7fe90

View file

@ -8,7 +8,8 @@ use vars qw($VERSION @ISA @EXPORT);
$VERSION = 0.01; $VERSION = 0.01;
@ISA = qw(Exporter); @ISA = qw(Exporter);
@EXPORT = qw(&slashifyDate); @EXPORT = qw(&slashifyDate
&fixEthnicity);
use vars qw(); use vars qw();
@ -20,6 +21,21 @@ sub slashifyDate {
return("$dateOut[2]/$dateOut[1]/$dateOut[0]") return("$dateOut[2]/$dateOut[1]/$dateOut[0]")
} }
sub fixEthnicity($) { # a temporary fix ethnicity, it should really be handled
# in Search.pm or the DB ...
my $ethnicity = shift;
if ($ethnicity eq 'maori') {
$ethnicity = 'Maori';
} elsif ($ethnicity eq 'european') {
$ethnicity = 'European/Pakeha';
} elsif ($ethnicity eq 'pi') {
$ethnicity = 'Pacific Islander'
} elsif ($ehtnicity eq 'asian') {
$ethnicity = 'Asian';
}
return $ethnicity;
}
1; 1;