in reply to Web-Safe Color Chart
As far as I know, and as merlyn pointed out, a Web safe palette should consist of 6 * 6 * 6 = 216 colours only.
Besides this, an obviuos improvement in the readability of your code could be using foreach instead of while loops, e.g.:
my @nums = qw/00 33 66 99 CC FF/; foreach my $r (@nums) { foreach my $g (@nums) { foreach my $b (@nums) { # Do something with $r, $g and $b } } }
The usual way of representing this palette is either an 8 * 8 grid (using only the first 216 cells) or 6 tables, 6 * 6 each. The second approach is easier to program, the first more compact.
Speaking about CGI.pm, since you don't process input parameters, can't generate errors, always use the same Content-type, there are no big security concerns that should force you to use CGI instead of rolling your own. Nonetheless it is a good exercise and a good starting point for studying the module, which should be customary for more complex CGIs.
-- TMTOWTDI
|
|---|