#!c:/indigoperl/bin/perl use CGI; use CGI::Carp; use CGI::Carp qw(fatalsToBrowser); use Win32::ODBC; my $q = new CGI; my $FileName = $q->param("FileName"); my $Submit = $q->param("Submit"); my $SubFile = $q->param("SubFile"); my $odbc = new Win32::ODBC(eFindX); my @Skills; my $SQL; my @row; my @lines; my $lcwords; #&check_fields; if ($Submit eq "") { if($SubFile eq "Add to Database") { &print_start; &search; &print_form; } else { &print_javaStart; print "This is where you can change your skills manually"; } } else { if($Submit eq "Yes") { &print_start; print "Your skills are correct"; } else { &print_start; print "Please edit your skills"; } } ###################################################################################################### sub print_start #Prints a page without javascript { print "Content-type: text/html\n\n"; print < Competitions

END_OF_THIS } ########################################################################################################### sub search { my $count; my @gotSkills; my $ArrCount; my $counter; my @LastArray; my $prev; my @out; $SQL = "SELECT fldSubSkillName FROM tblSkills"; if ($odbc->Sql($SQL)) { &sql_error; } $count = 0; while ($odbc->FetchRow()) { @row = $odbc->Data(); @Skills[$count] = $row[0]; $count++; } $countSkills = 0; foreach $pattern(@Skills) { open CP,$FileName or die "Please select a file before pressing Submit or press Enter Manually to type in your skills your self"; binmode(CP); @lines = ; foreach $line(@lines) { if( $line =~ /$pattern/ ) { @gotSkills[$countSkills] = $pattern; $countSkills++; } } #print $Skill; } print "these are your skills are they correct:

"; #$counter = 0; #foreach $gSkill(@gotSkills) #{ #$ArrCount = 0; #foreach $SgSkill(@gotSkills) #{ #if($SgSkill eq $gSkill) #{ #if($ArrCount < 1) #{ #@LastArray[$counter] = $SgSkill; #$ArrCount++; #$counter++; #} #} #} #} $prev = "not equal to $gotSkills[0]"; @out = grep($_ ne $prev && ($prev = $_, 1), @gotSkills); foreach $Gskills(@out) { print "$Gskills
"; } } ########################################################################################################### sub sql_error { print "SQL Error:" . $odbc->error() . "\n"; $odbc->Close(); exit; } ########################################################################################################### sub print_form { print "
"; } ########################################################################################################### sub print_javaStart #Prints a page without javascript { print "Content-type: text/html\n\n"; print < Competitions

Skill
END_OF_THIS } ###########################################################################################################