Help for this page

Select Code to Download


  1. or download this
    use Tie::Toggle;
    
    ...
    my @color = qw(black white);
    
    print "$color[$toggle]\n" for 1..10;
    
  2. or download this
    use Tie::Cycle;
    
    tie my $color, 'Tie::Cycle', [qw(red white blue)];
    print "$color\n" for 1..10;
    
  3. or download this
    use Tie::Cycle;
    use Color::Spectrum qw(generate);
    
    tie my $color, 'Tie::Cycle', [generate(4,'#ff00ff','#00ff00')];
    print "$color\n" for 1..10;