in reply to Unable to print the contents of an array reference passed from the main pgm to the flat file

update: ignore this, I misread the start of the script :-(

Is argument 6 @ff? If so it looks as though it is getting clobbered when you "determine the field names".

# determine the field names if ($colNamesHdl) { @ff=(); for ($i=0; $i <= $#$colNamesHdl; $i++) { push(@ff, $$colNamesHdl[$i]); } } else { $k = $$rowsHdl[0]; @ff = keys(%$k); }
Either unshift the field names onto @ff or perhaps just print the field names outside your for loop and leave @ff well alone.

update: changed shift to unshift

  • Comment on Re: Unable to print the contents of an array reference passed from the main pgm to the flat file
  • Select or Download Code