Being that your question is still a little vague to me, there is a chance I'm misunderstanding it. However, I will explain my assumptions and we can run from there:
I'm assuming:
1. You have a static *.html table that has, among other things, row/columns with one of three colors in them.
2. If you click a link relative to one of these rows, you would like to be directed to another page with the 'linked' color.
If I'm incorrect with either of my two assumptions, please let me know and I will try to re-factor my answer. Though, given these assumptions, here is something you can do:
Your HTML links could resemble the following:
<a href="color.cgi?source_color=red">Red link</a>
Next, in the CGI script, you could code the following:
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
my $source = CGI::param( 'source_color' );
my $color_map = {
'red' => 'CCFF33',
};
my $destination = '#' . ( $color_map->{$source} || 'CCFF33' );
Now, for each of the 'source' colors relative to the link, you will be able to translate it to the destination
HTML color code. Then, using the HEX representation of the color within the
$destination variable, you will be able to use it where every you like throughout your code.
Again, I might not understand your real problem. If this doesn't sound like a solution like you were looking for, feel free to elaborate on your question. Otherwise, hope this helps!
---hA||ta----
print map{$_.' '}grep{/\w+/}@{[reverse(qw{Perl Code})]} or die while ( 'trying' );
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.