Created
July 9, 2012 12:10
-
-
Save ynonp/3076116 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.14; | |
use Spreadsheet::WriteExcel; | |
# Create the work book | |
my $workbook = Spreadsheet::WriteExcel->new('writer1.xls'); | |
my $ws = $workbook->add_worksheet(); | |
my @data = qw/red blue green white cyan magenta black/; | |
while ( my ($idx, $val) = each @data ) { | |
my $fmt = $workbook->add_format; | |
$fmt->set_color( $val ); | |
$ws->write( $idx, 0, $val, $fmt ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment