Update: also consider simplifying your code using strftime from POSIX:
use strict; use warnings; use Spreadsheet::WriteExcel; use POSIX; my $fmt = strftime('%Y-%m-%d_%H%M%S', localtime); my $SP_summary_filename = "NARA_SP_$fmt.xls"; my $LUN_summary_filename = "NARA_LUN_$fmt.xls"; my $DISK_summary_filename = "NARA_Disk_$fmt.xls"; my %AH; my $INFO='SP'; $AH{'SS'}{$INFO}{'POINTER'}=Spreadsheet::WriteExcel->new($SP_summary_f +ilename); $AH{'SS'}{$INFO}{'SS_NAME'}=$SP_summary_filename; $INFO='LUN'; $AH{'SS'}{$INFO}{'POINTER'}=Spreadsheet::WriteExcel->new($LUN_summary_ +filename); $AH{'SS'}{$INFO}{'SS_NAME'}=$LUN_summary_filename; $INFO='DISK'; $AH{'SS'}{$INFO}{'POINTER'}=Spreadsheet::WriteExcel->new($DISK_summary +_filename); $AH{'SS'}{$INFO}{'SS_NAME'}=$DISK_summary_filename; for $INFO (keys %{$AH{'SS'}}) { print "The spreadsheet is $AH{'SS'}{$INFO}{'SS_NAME'}.\n"; $AH{'SS'}{$INFO}{'top_left_header_format'}=$AH{'SS'}{$INFO}{'POINT +ER'}->add_format(); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_color('white'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_bg_color('navy'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_font('Arial'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_size(8); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_bold(1); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_text_wrap(1); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_align('center'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_valign('vcenter'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_left('2'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_top('2'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_bottom('1'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_right('1'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_left_color('8'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_top_color('8'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_bottom_color('9'); $AH{'SS'}{$INFO}{'top_left_header_format'}->set_right_color('9'); $AH{'SS'}{$INFO}{'FIRST_WS'} = $AH{'SS'}{$INFO}{'POINTER'}->add_wo +rksheet("Test"); $AH{'SS'}{$INFO}{'FIRST_WS'}->set_column('A:A', 2); $AH{'SS'}{$INFO}{'FIRST_WS'}->write_string('A1',"TEST TEST",$AH{'S +S'}{$INFO}{'top_left_header_format'}); print "For fun:\n"; print "$AH{'SS'}{$INFO}{'POINTER'}\n"; print "$AH{'SS'}{$INFO}{'top_left_header_format'}\n"; print "$AH{'SS'}{$INFO}{'FIRST_WS'}\n"; print "End of pass.\n"; print "\n"; $AH{'SS'}{$INFO}{'POINTER'}->close(); }
In reply to Re: Hash with WriteExcel
by toolic
in thread Hash with WriteExcel
by wsand101
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |