... # your code above here ## Housekeeping $workbook->close() or die "Error closing file: $!"; close(PROP); { ## COMPARISON use Data::Dump qw/dd dump/; my $old_ws_parse = $worksheet_parse; # copy to new name for symmetry, below my $new_wb_parse = $parser->parse( 'new.xls' ) or die $parser->error(), "Error processing new workbook parse.\n"; my $new_ws_parse = $new_wb_parse->worksheet( 'Sheet1' ); open(my $compare_fh, '>', 'compare_formats.txt') or die "compare_formats.txt: $!"; # get in the habit of using lexical filehandles for my $row ( $row_min .. $row_max ) { for my $col ( $col_min .. $col_max ) { my $oldcell = $old_ws_parse->get_cell($row,$col) or next; my $newcell = $new_ws_parse->get_cell($row,$col) or next; # to STDERR dd 'oldformat => ', my $oldformat = $oldcell->get_format(); # you could use Data::Dump::dump() instead, if you want to print to your own file (similar to dd 'newformat => ', my $newformat = $newcell->get_format(); # to file handle print $compare_fh 'oldformat => ', dump($oldformat), "\n"; print $compare_fh 'newformat => ', dump($newformat), "\n"; } } } exit;