in reply to OT? Download to Excel number formats not working

This will not solve your problem, but it may come in handy in the future. Instead of comparing $key to all those strings as you are doing, you could place the strings into an array, then use the any function from the CPAN module, List::MoreUtils, to do the comparison.
foreach my $c (qw(col_endow col_gfund col_restr col_total)) { if ( substr($key,0,3) eq "010" || substr($key,0,3) eq "023" || substr($key,0,3) eq "025" || substr($key,0,3) eq "027" || substr($key,0,3) eq "030" || substr($key,0,3) eq "043" || substr($key,0,3) eq "045" || substr($key,0,3) eq "066" || substr($key,0,3) eq "097" ) { $row_data{num_style} = 'style="vnd.ms-excel.numberformat:$ +*

can be replaced by:

use List::MoreUtils qw(any); my @specials = qw(010 023 025 027 030 043 045 066 097); foreach my $c (qw(col_endow col_gfund col_restr col_total)) if (any { substr($key,0,3) eq $_ } @specials) { $row_data{num_style} = .....

Replies are listed 'Best First'.
Re^2: Download to Excel number formats not working
by Lori713 (Pilgrim) on Aug 01, 2008 at 13:52 UTC
    Sweet! I learn something new every time I come here. Thanks!