Greetings, 

a couple of questions here,
-------


# Text colors
@colors = qw[
#F0F8FF #00FFFF #7FFFD4 #F0FFFF #F5F5DC #FFE4C4
#000000 #0000FF #8A2BE2 #A52A2A #5F9EA0 #7FFF00
#FF7F50 #DC143C #00FFFF #00008B #008B8B #B8860B  
#FA8072 #F4A460 #2E8B57 #A0522D #6A5ACD #00FF7F 
#4682B4 #D2B48C #008080 #FF6347 #EE82EE #FFFF00 
#D2691E
];


# choose a color!
# avoid the same color twice in a row!

sub choseColor{
return int (rand ($#colors + 1));
}

# $#colors + 1 --> better written as  int (rand @colors);
# is this ok, using an @array as in a loop to 
# like:  while ($i < @array) {... do something...; $i++} 


# print out some values

while ($i < 1000 ){

$color_choice = &choseColor;

# never happens ?!?

 print "###dup###\n" if ($color_dup == $color_choice);


print "$color_dup  $color_choice\n";

$color_dup = $color_choice;

$i++;
}

# print some html
print qq|<font color="$colors[$color_choice]">some text</font>\n|;
--------------------------------------------
Looking for Web Talent, You found it!
portfolio: www.coraconnection.com/web/
email: [EMAIL PROTECTED]
tel/fax: (860) 231-9988
--------------------------------------------

Reply via email to