in reply to Re^4: Uninitialized value in concatenation (.) or string?
in thread Uninitialized value in concatenation (.) or string?

The print statement will still work - an undef value will print as the empty string.

Sorry, I mistook line 71 for a similar looking line (the one in the foreach $intersect (@uniq) loop.)

If this is where you problem is:

my $refarray3 = $matchedfiles[5]; print "File: ${$refarray3}[0] in directory ${$refarray3}[1]\n";
then maybe $refarray3 is undef. How many elements are there in the @matchedfiles array?

Replies are listed 'Best First'.
Re^6: Uninitialized value in concatenation (.) or string?
by jbush82 (Novice) on May 09, 2008 at 18:36 UTC
    I'm trying to pass two elements per row. The filename and the MD5 value.

    print "\n\n"; my $refarray3 = $matchedfiles[5]; print "it's not defined!\n" unless defined(${$refarray3}[0]); print "it's not defined!\n" unless defined(${$refarray3}[1]); print "File: ${$refarray3}[0] in directory ${$refarray3}[1]\n";
    Both of the elemnts in the 5th row of the matchedfiles array show the output of not being defined. It seems as if nothing is being passed to the array, when back on line 63 I have the following:

    push(@{$matchedfiles[$c]}, [${$refarray1}[0], ${$refarray1}[1]]); I've updated the main post with the latest code.
      Maybe that statement is never getting executed when $c is 5 - it's in an if statement after all. What's so special about 5?

      You should just dump the entire @matchedfiles array to see what you have:

      use Data::Dumper; print Dumper(\@matchedfiles);
        Nothing is special about 5, I just picked a number (row) that I knew would have the a file name and md5 associated with it. Basically that is there to just test that the matchedfiles array is holding the data it should... wich it isn't.

        This is strange... the output is as follows:

        $VAR1 = [ undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, [ [ 'g[1].gif', 'C:\\Documents and Settings\\Administrator\\Local Settin +gs\\Temporary Internet Files\\Content.IE5\\Q5E56VYH' ] ], undef, undef, undef, undef, undef, undef, undef, undef, undef,


        The undef go on a LOT longer than I showed... but 100s or even 1000s of lines, it shows the first file and directory, then goes on again.