Board: iglu Project

Subject

Perl

Author

Ben James

Status

Date

01/02/1999 21:23

Message

Below is my Perl code so for for Perl Forager.
I need some help in creating a copy of the current record into something like a hash or a record from the SkiResort table, then using some of its fields to create a forager value, which would then be stored in a hash table.
Then I would repeat this with the chalets, adding its Resorts Score to the final score. Putting this total score into an array which would then be sorted. Providing an ascending list of IDs.
Any ideas you could explain to me would be greatly appreciated.
Ben Janes
#!C:/Perl/5.005/bin/MSWin32-x86-object/perl.exe
use strict;
use CGI qw(:standard param);
use Win32::ODBC;
my $DB=undef;
my $DSN="IGLU";
my $Prox=undef;
my $NLife=undef;
my $Diff=undef;
my $Price=undef;
my $FsPtr=undef;
my $LsPtr=undef;
my %Resorts=undef;
# Open DB through ODBC
if (!makeConnect($DSN)) {
exit();
} else {
}
get_Vars();
get_Resorts();
get_Chalets();
send_Results();
exit();
sub get_Resorts(){
my $Field1="SkiResort";
$DB->Sql("SELECT SkiResort.* FROM SkiResort ORDER BY SkiResort.ID;");
}
sub get_Chalets(){
}
sub get_Vars{
$NLife=param('NLife');
$Price=param('Price');
$Prox=param('Prox');
$Diff=param('Diff');
$FsPtr=param('FsPtr');
$LsPtr=param('LsPtr');
}
sub makeConnect{
my ($mDSN)=@_;
if (!($DB = new Win32::ODBC($mDSN))){
return 0;
} else {
return 1;
}
}
sub send_Results{
print header;
print start_html("Parameters");
print h1("Parameters");
print p("$NLife , $Price , $Prox , $Diff , $FsPtr , $LsPtr");
print $Resorts{"1"};
print end_html;
}

iglu Project Board

 

Post Follow-up

Search This Board

 

Message Context:

Perl Ben James 01/02/1999 21:23

    Re: Perl Tim Joyce 02/02/1999 09:48



Home -  News -  Reference Sites -  Members -  Partners -  Guidelines -  Philosophy -  Your Details -  Logout