in reply to Re^2: combining 2 files with 4 columns need help
in thread combining 2 files with 4 columns need help

Looks like you have a primary key in one file only. Add a print to confirm ;
print "$pk\n"; my @dates = @{$hash{$pk}[1]}; my @rdates = @{$hash{$pk}[2]};
poj

Replies are listed 'Best First'.
Re^4: combining 2 files with 4 columns need help
by rruser (Acolyte) on May 29, 2013 at 19:37 UTC

    you are right it has a primary key in only 1 file, this will occur potentially in either file. one date is order date the other is release date..can it be taken into account?

    thanks so much

      Yes OK, try
      my @dates = (defined $hash{$pk}[1]) ? @{$hash{$pk}[1]} : (); my @rdates = (defined $hash{$pk}[2]) ? @{$hash{$pk}[2]} : ();
      poj

        That worked great!!! You are a life safer. Thanks so much - rruser