Add use warnings; use strict;, then fix the errors. It seems to work for me: I get a "Test" worksheet, and the string "TEST TEST" is written into A1 on each worksheet.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.