in reply to How is this syntax breaking my code?

First, you don't need those quotes.

Second, if you use diagnostics or -Mdiagnostics (on the Perl command line), then you'll get an explanation of the error message.

Third, I couldn't see how that error would apply to the code you give so I tried to look up the error in perldiag.pod (which contains all of the error descriptions that use diagnostics can give you). There is no such error. There is this:

Can't coerce array into hash

(F) You used an array where a hash was expected, but the array has no information on how to map from keys to array indices. You can do that only with arrays that have a hash reference at index 0.

So it looks like you got the error message backward and that $temp_dcr{$currentkey} contains a reference to an array (instead of a reference to a hash) for at least one value of $currentkey. (The explanation of the error might be a bit confusing if you don't know about pseudo-hashes, which are being phased out so don't worry about them.)

You can look at how you are populating $temp_dcr to try to figure out how an array reference is getting in there. Or you could debug the problem (use the perl debugger's "x" command or Data::Dumper to display what the contents of $temp_dcr look like before you enter the loop, for example).

        - tye (but my friends call me "Tye")