Setting items in perl and accessing them in C