I gather your problem is solved, but I felt compelled to nit-pick about the OP code a little bit... Your use of the C-style for loop makes extra work for you, and your repeated testing of the "sdd" element inside the "srs" loop makes extra work for your cpu.

Doing it this way would save you and your cpu some effort:

for my $sdd ( @gSDDdata ) { next unless ( ref( $sdd ) eq 'HASH' and $$sdd{source} ); for my $srs ( @gSRSData ) { next unless ( ref( $srs ) eq 'HASH' and $$srs{sect} ); $$srs{found} = $$sdd{found} = 1 if ( $$sdd{source} =~ /$$srs{sect}/ ); } }
Also, it's usually a very minor point, but if there were a lot more "sdd" things than there are "srs" things, it would be better to have the larger number of things as the inner-most loop (other things being equal...)

(Update: I thought about using ( ref( $sdd ) eq 'HASH' and defined( $$sdd{source} )) and likewise for srs, but since the crux of the process involves a regex match (which works on strings), I assumed you wouldn't be working on numerics (e.g. "0"), and you wouldn't want to set "found" = 1 in the case where $$srs{sect} was an empty string and $$sdd{source} could be anything at all. But it's up to you to decide how much to trust the data.)


In reply to Re: Use of unintialized value in pattern match (m//) at x.pl line 123 by graff
in thread Use of unintialized value in pattern match (m//) at x.pl line 123 by gibsonca

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.