Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Red
  2. Yellow
  3. Orange
  4. Blue
  5. Black
  6. Brown
  7. Green
  8. White
  9.  
  10. <div>
  11. <% $color_selector %>
  12. </div>
  13.  
  14. my %all_colors = (
  15. 1 => 'Red',
  16. 2 => 'Yellow',
  17. 3 => 'Orange',
  18. 4 => 'Blue',
  19. 5 => 'Black',
  20. 6 => 'Brown',
  21. 7 => 'Green',
  22. 8 => 'White',
  23. );
  24.  
  25. my $color_selector = '<select name="all_colors">';
  26.  
  27. foreach my $color (sort {$all_colors{$a} cmp $all_colors {$b}} keys %all_colors ) {
  28. $color_selector .= qq~<option value="$color">$all_colors{$color}</option>~;
  29. }
  30. $color_selector .= '</select>';
  31.  
  32. use constant MAIN_COLORS => {
  33. 1 => 'Red',
  34. 2 => 'Yellow',
  35. 3 => 'Orange',
  36. 4 => 'Blue',
  37. };
  38.  
  39. sub main_colors {
  40. return keys %{MAIN_COLORS()};
  41. }
  42.  
  43. <div>
  44. <input type="checkbox" name="maincolors" value="1" class="inputCheckbox" /> Main Colors
  45. <input type="checkbox" name="resetofcolors" value="1" class="inputCheckbox" /> Rest of the Colors
  46. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement