in reply to Re: Array refs problem ...
in thread Array refs problem ...

Yeah I think the problem is with the way I'm dong that somehow. Adding :
printf STDOUT ("1-->%s<--\n", $Row->{ Cells } ); printf STDOUT ("2-->%s<--\n", $FieldOrder ); printf STDOUT ("3-->%s<--\n", $Row->{ Cells }[ ( @$FieldOrder ) ] ) ;
Gave me
1-->ARRAY(0x2af07dc)<-- 2-->ARRAY(0x2ab07dc)<-- 3-->HASH(0x2b50058)<--
I don't know what I would have expected for the last one (I think that's like saying $Array[1..4], which surely should be written @Array[1..4], but what do I know ...)
Update Thanks, but tried that first, didn't work, same error.
Update2 Oh wait, I missed that you removed the ( ) around @$FieldOrder also, I seem to be making progress now. Many thanks!

Replies are listed 'Best First'.
Re^3: Array refs problem ...
by ikegami (Patriarch) on Jun 24, 2009 at 17:44 UTC

    Oh wait, I missed that you removed the ( ) around @$FieldOrder also, I seem to be making progress now. Many thanks!

    Only because they were distracting. They have absolutely no effect here.

    Just like you wouldn't use $z=($x)+($y) instead of $z=$x+$y, there's no reason to use @a[(@$b)] instead of @a[@$b].