in reply to Re^2: Perl script to check database works or does it?
in thread Perl script to check database works or does it?

No problem, may be you can redeem yourself in pointing out why I am getting "Use of uninitialized value $ref in join or string at dbmigration.pl line 124. Use of uninitialized value $ref1 in join or string at dbmigration.pl line 148." errors? :0)

  • Comment on Re^3: Perl script to check database works or does it?

Replies are listed 'Best First'.
Re^4: Perl script to check database works or does it?
by chris01010 (Novice) on Jan 05, 2016 at 11:32 UTC

    OK, got it. It's because the DB return contains NULL values so the code is basically trying to do a join on an empty string!

    I have added the below just before the join and it has fixed it.

    foreach (%$ref) {$_ = '' unless defined};

    Thanks all

      A hash key can never be undefined. Loop over the values only:
      defined or $_ = '' for values %$ref;

      Or, in newer Perls,

      $_ //= '' for values %$ref;
      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,