in reply to Not getting proper output in array write

G'day suvendra123,

As already pointed out by ++Corion, the code you posted does not compile. It has so many problems that I don't know where to start. If you post the actual code that produced your broken output, we can tell you where you went wrong. Please post that code, and any output, within <code>...</code> tags. Thankyou.

These two lines produce the output that you seem to want, assuming '[1}' should in fact be '{1}'.

$ perl -E ' my @a = qw{HRT RD WR LL DC}; say "bins $a[$_] = {", $_, "};" for 0 .. $#a; ' bins HRT = {0}; bins RD = {1}; bins WR = {2}; bins LL = {3}; bins DC = {4};

Update: Originally, my code, and consequently the output, had 'bin'; I changed that to 'bins'.

— Ken