in reply to [untitled node, ID 130617]

jaldhar has the right idea. What you're trying to do is to use symbolic references. Here's my taunt: don't do that.

Here's a better approach:

my %colorsets = ( samn => [ "#A5A5A5", "#84B594", "#84A5C6", "#DE6BA5" ], atari => [ "#00ff00", "#8fbc8f", "#ffcc00", "#000000", "#33cc00", " +#330099", "#363636" ], ); my $set = $ENV{QUERY_STRING}; my $colors = (defined $set and exists $colorsets{$set}) ? $colorsets{$set} : $colorsets{samn}; my $numcolors = @$colors; for (0 .. $totcells) { my $cellcol = $colors->[ rand $numcolors ]; # the rest as above }
  • Comment on Re: How can I specify which array to use with $ENV(queary_string)?
  • Download Code