Is this where (if you uncommented the print statement) you are getting the "Uninitialized value in concatenation..." error:
( $dir, $file ) = m/(.*)[\\\/](.+)/ ? ( $1, $2 ) : ( undef, $_ ); # print "$file is in the directory $dir\n"; $fileinfo[$i] = [$file, $dir];
If so, it's probably because $dir is getting set to undef, and then you are using it in string interpolation in the print statement.

Also, later that undef value could be causing problems in this code fragment:

$refarray1 = $fileinfo[$c]; if (${$refarray1}[0] eq $intersect) { print "File: ${$refarray1}[0] in directory ${$refarray1}[1]\n"; $matchedfiles[$i] = [${$refarray1}[0], ${$refarray1}[1]]; }
The expression ${$refarray1}[1] refers to the dir component of your fileinfo structure, so if it is undef, the print statement in this fragment will also generate the same error message.

Also, don't you want to increment $i in this loop?

$matchedfiles[$i++] = [${$refarray1}[0], ${$refarray1}[1]];
In general it's easier to use push: push(@matchedfiles, [ ... ]);

Update: Here are some style pointers that might make things a little cleaner.

1) Read the md5 info into a hash:

my %md5_of_known_bad; foreach $md5data (@knownbad) { ... $md5_known_bad{$filename} = $md5hash; }
This serves two purposes: it stores the md5hash of a known bad file and it also can be used to determine if a file is a bad file by using exists:
if (exists $md5_of_known_bad{$filename}) { # $filename is a known bad }

2) Your intersection logic can then be simplified to:

my @uniq; @uniq = grep { exists $md5_of_known_bad{$_} } @sysfiles;

In reply to Re: Uninitialized value in concatenation (.) or string? by pc88mxer
in thread Uninitialized value in concatenation (.) or string? by jbush82

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.