#!/DOCUMENT_ROOT/OCEAN_PLANET/SUPPORT_PROGRAMS/perl # Get the document root from the path to perl. ($dr) = $^X =~ m@^(.*)/OCEAN_PLANET/@; $sn = (reverse(split(/\//,$0)))[0]; $oi = '/OCEAN_PLANET/IMAGES'; # Read the file containing the list of alien species. $file = "$dr/OCEAN_PLANET/CAPTIONS/bioroulette.text"; open(FILE,$file) || die "Could not open file, $file; stopped"; undef $/; $text = ; close FILE; $/ = "\n"; $* = 1; $text =~ s/^#.*\n//g; # Remove comment lines. $* = 0; @aliens = split(/\n\n/, $text); $num_aliens = scalar(@aliens); if($ENV{'QUERY_STRING'} eq ''){ # Randomly pick one of the alien species. srand($^T|$$); # Set the random number seed. $rnum = int(rand($num_aliens)); # Pick a random number. } elsif($ENV{'QUERY_STRING'} eq 'all'){ &display_all(@aliens); } else{ # Pick the specified alien species. $rnum = int($ENV{'QUERY_STRING'}); $rnum >= 0 && $rnum < $num_aliens || ($rnum = 0); } # Unpack that alien ($sci,$com,$img,$ref,$frm,$to,$mth,$eff) = split(/\n\n/, $aliens[$rnum]); # Some aliens do not have references. if($ref eq 'noref'){ $ref = ""; } else{ $ref = "§"; } &head; print <<"--";

Biological Roulette


Click on the wheel to see how some alien species were introduced, and what happened.

$com $ref


$sci -- &from_to_etc($frm,$to,$mth,$eff); print <<"--";
Display the entire list of alien species. -- &tail; ################################################################################ sub display_all{ &head; print <<"--";

Below is a list of all of the alien species currently described in our exhibit.


-- foreach (@_){ ($sci,$com,$img,$ref,$frm,$to,$mth,$eff) = split(/\n\n/); print <<" --"; $com ($sci) -- &from_to_etc($frm,$to,$mth,$eff); print <<" --";
-- } &tail; } ################################################################################ sub from_to_etc{ local($frm,$to,$mth,$eff) = @_; print <<"--";
From: $frm
To: $to
Effect: $eff
How introduced: $mth -- } ################################################################################ sub head{ print <<"--"; Content-type: text/html Ocean Planet Biological Roulette -- } ################################################################################ sub tail{ print <<"--";

Back to Alien Species

Ocean Planet Exhibition Floorplan

Gene Carl Feldman (gene@seawifs.gsfc.nasa.gov) &
Judith Gradwohl (Curator/Ocean Planet)
-- exit; }