in reply to Runtime Hash Variable access

First, use code tags here, ok.

I assume you don't use 'use warnings' here? You neeed to use it catch problems like these. Eg you haven't declared any hashes. Should be like this:
%ABCDev = qw /A 1 B 2 C 3/;
But, i'm not sure if the loop will work either. You need to try it again. It might be better to save references into array.
@prods=(\%ABCDev,\%DEFDev,\%GHIDev); for($i=0;$i<=$#prods;$i++) { @prodkeys = keys %{$prods[$i]}; print "@prodKeys\n"; }

Replies are listed 'Best First'.
Re: Re: Runtime Hash Variable access
by Juerd (Abbot) on Mar 08, 2004 at 14:23 UTC

    %ABCDev = qw /A 1 B 2 C 3/;

    Technically, that *defines* (assigns to) %ABCDev, but it doesn't *declare* it. You declare a variable with my, our or use vars.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      You are right. Mainly ment that the wanted hash %ABCDev was empty due that assingment happened to scalar and not hash. And that using 'use strict' and 'use warnings' would have caught the mistake.

      I just don't always think that much about words than meaning (which in some cases can be somewhat obscure due to my lack of attention to words :D).
Re: Re: Runtime Hash Variable access
by spaceforsrini (Initiate) on Mar 08, 2004 at 15:17 UTC
    Your code worked fine. Except I had to change the prodKeys to prodkeys :-) Thanks for immediate reply