#!/usr/bin/perl #use CGI; #$q=new CGI; open(DATA,"; close DATA; @shuffled=shuffle(@stuff); #@shuffled=@stuff; sub shuffle { my @array = @_; my @rand = undef; $seed = $#array + 1; my $randnum = int(rand($seed)); $rand[$randnum] = shift(@array); while (1) { my $randnum = int(rand($seed)); if ($rand[$randnum] eq undef) { $rand[$randnum] = shift(@array); } last if ($#array == -1); } return @rand; } @pokemons=shuffle("a","b","c","d","e","f","g"); @pills=shuffle("h","i","j","k","l","m"); $porep=$pokemons[0]; $pirep=$pills[0]; print "Content-type: text/html\n\n"; print < Pokemon or Pill?
Pokemon or Pills
Pokémon or Pill?

EOD print < EOD for ($i=0;$i<10;$i++) { $name=$shuffled[$i]; $name=~s/\|.*$//; if ($i % 2) { $even=false; } else { $even=true } if ($even eq "true") { print "\n"; } print <$name EOD if ($even eq "false") { print "\n"; } } print <

...

Reload for more!

The Pokemon registered trademark is owned by Nintendo. All medications are trademarked by their respective trademark holders. No endorsement of said drugs or medications are implied.

EOD foreach $item (@stuff) { chop($item); (my $name,my $type) = split(/\|/,$item); if ($type eq "pill") { print "$name "; } } print "

\n"; sub deadcode { print "not done.
Your submit:

\n"; for $key ( $q->param() ) { $input{$key} = $q->param($key); } for $key ( keys %input ) { print $key, ' = ', $input{$key}, "
\n"; } }