It might be a scoping issue, you didn't supply enough code for how you are feeding the list to the make_sections. Here is some code that seems to produce what you wanted if I understand correctly.
use Data::Dumper; my @tmp; @data = <DATA>; make_sections(@data); print Dumper(\@tmp); sub make_sections { my $tmp; for (@_) { my $fn = $_; print "$fn\n"; my $pnum = substr($fn, 6, 3); $pnum =~ s/0//; my $section = substr($fn, 5, 1); push @tmp, $section; #$MAIN::PageInfo{$section}{$pnum} = $_; #s/$MAIN::fileExt/$MAIN::imgExt/; #$MAIN::PageInfo{$section}{$fn} = $_; #print "Name: $PageInfo{$section}{$pnum} Section: $se +ction PNum: $pnum Thumb: $PageInfo{$section}{$fn} \n"; } print "Exiting Make Sections.\n"; return @tmp; } __DATA__ R3012G006.PDF R3012G007.PDF R3012G008.PDF R3012H001.PDF R3012H002.PDF R3012H003.PDF R3012H004.PDF R3012H005.PDF R3012H006.PDF R3012J001.PDF R3012J002.PDF R3012J003.PDF R3012J004.PDF R3012J005.PDF R3012J006.PDF R3012J007.PDF R3012J008.PDF R3012J009.PDF R3012J010.PDF R3012J011.PDF R3012J012.PDF R3012J013.PDF R3012J014.PDF R3012J015.PDF R3012J016.PDF R3012J017.PDF R3012J018.PDF R3012J019.PDF R3012J020.PDF R3012J021.PDF R3012J022.PDF R3012J023.PDF R3012J024.PDF R3012J025.PDF R3012J026.PDF R3012J027.PDF R3012J028.PDF R3012J029.PDF R3012J030.PDF R3012J031.PDF R3012J032.PDF
Some modifications may be needed to meet your goal, but I think it provides the results you are loooking for.

In reply to Re: Push can shove it. by trs80
in thread Push can shove it. by HamNRye

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.