The code below works on perl 5.8.1, but gives the error "can't use string ("13") as an ARRAY ref while 'strict refs' in use" when executuing the sort command at the bottom with version 5.10. Help would be appreciated

my $filename = shift; my $refdataarr = shift; my $rows; my $cols; my $Excel; my $Book; my $Sheet; my @files; my @title = (qw/File QAC_off QAC_nod Lvl_9 Lvl_8 Lvl_7 Lvl_6 Lvl_5 L +vl_4 Lvl_3 Lvl_2 Lvl_1 Lvl_0 Sum/ ); my $total_cols = @title; # 14 if ( -f $filename ) { if (! unlink($filename) ) { printf("Can not delete '%s'. Excel file not created!\n", $fi +lename); return; } } $Excel = Win32::OLE->new("Excel.Application",sub {$_[0]->Quit;}) or die "Oops, cannot start Excel"; $Book = $Excel->Workbooks->Add; $Sheet = $Book->Worksheets(1); @files = sort { lc(${@$a}[0]) cmp lc(${@$b}[0]) } @$refdataarr ;

In reply to "strict" violation on "sort" command with perl 5.10 by mstet

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.