in reply to Re^3: Adding hashes to already existing array
in thread Adding hashes to already existing array

The syntax "$%{$excerpts[$i]}{fpart}" is probably not doing what you want - it's populating a hash "%%"!

Thank you for the bit about it actually being the hash %%. I thought I knew references well enough and now I guess I didn't. I have been re-reading the books and docs on references for the last few days and hope to never again utter such execrable desecrations.

Replies are listed 'Best First'.
Re^5: Adding hashes to already existing array
by haukex (Archbishop) on May 12, 2016 at 10:03 UTC

    Hi ExReg,

    You may want to have a look at perlcritic, which can be helpful in catching some potential issues in addition to strict and warnings. For example, in this case it would have issued a warning 'Magic variable "$%" should be assigned as "local"' in regards to the %% hash (its analysis is not perfect but in this case at least it gives a hint), and a warning 'Capture variable used outside conditional', which stevieb already correctly pointed out. If you run perlcritic --verbose 10 ..., you will get a brief explanation of the issue as well. perlreftut and perlref are also good sources of information on references.

    Hope this helps,
    -- Hauke D