Mercurial > boosterpack
view index.pl @ 2:d7dd496a4fa6 boosterpack
[svn r4] actual functionality!
author | robert |
---|---|
date | Tue, 08 Sep 2009 02:45:26 -0400 |
parents | 477258d09353 |
children | 2e849c856026 |
line wrap: on
line source
1 #!C:/strawberry/perl/bin/perl.exe3 use List::Util qw(first max maxstr min minstr reduce shuffle sum);4 use Storable;5 use CGI::Ajax;6 use CGI;7 use Rule;8 use Filter;9 use Card;10 my $q = new CGI;14 my $refstruct = retrieve 'CARD.perl';15 my @pokes = @$refstruct;21 my %hash = ( 'gen_pack' => \&gen_pack, 'change_rules' => \&change_rules);28 my $pjx = CGI::Ajax->new(%hash);29 #$pjx->JSDEBUG(1);30 #$pjx->DEBUG(1);32 print $pjx->build_html($q,\&gen); # this outputs the html for the page38 sub change_rules39 {40 my $currentRuleref = retrieve 'rlm/booster.prefs';41 $currentRule = $$currentRuleref;42 $a = shift;43 $currentRule -> setSets(($a));44 store \$currentRule, 'rlm/booster.prefs';45 return $a;48 }59 sub gen_pack60 {61 sub tag_analyze62 {66 my @sets = $currentRule -> getSets();67 #print ERR @sets;69 my $card = shift;71 #print ERR $card->getPix();72 #print ERR "\n";73 return $card -> hasTags(@sets);76 }78 my $currentRuleref = retrieve 'rlm/booster.prefs';79 $currentRule = $$currentRuleref;81 #print ERR "@pokes";82 @reduced = filter(\&tag_analyze, @pokes);84 #print ERR "@reduced";86 for $crd(@reduced)87 {88 #print ERR $crd->getPix();89 $rob = $rob.$crd->getPix();90 $rob = $rob."<br>";91 }93 #print $rob;95 #print ERR @reduced;96 #print ERR $rob;97 #print $rob;98 return $rob;99 #close ERR;102 };108 sub gen109 {110 open FILE, "<index.html";111 return do { local $/; <FILE> };112 };114 #print "done";116 #print &change_rules("Fossil");117 #print &gen_pack;