# place these somewhere in the BEGIN Section # my $DateFmt = "yyyy-mm-dd" ; my %HtmlShitAry ; $HtmlShitAry{ ' ' } = ' ' ; $HtmlShitAry{ ''' } = "'" ; $HtmlShitAry{ '"' } = '"' ; # Watch this one -- it bites !!! $HtmlShitAry{ '&' } = '&' ; $HtmlShitAry{ '<' } = '<' ; $HtmlShitAry{ '>' } = '>' ; my $HtmlShitREx = join "|", keys %HtmlShitAry ; $HtmlShitREx = qr/$HtmlShitREx/ ; # # place those somewhere in the BEGIN Section : # # then, to 'fix' excess precision, add 0 to unformatted() ; # if ( defined $Cell->{Type} ) { if ( $Cell->{Type} eq 'Date' ) { $Val = ExcelFmt( $DateFmt, $Cell->{Val} ); } elsif ( $Cell->{Type} eq 'Numeric' ) { $Val = ( $Cell->unformatted() ) ? $Cell->unformatted() +0 # fix precision ! : 0 ; } else { $Val =~ s/($HtmlShitREx)/$HtmlShitAry{ $1 }/g ; } } else { $Val =~ s/($HtmlShitREx)/$HtmlShitAry{ $1 }/g ; }