http://www.perlmonks.org?node_id=1014859


in reply to Multidimensional arrays within arrays

Thank you everyone for their suggestions.. Some smart manipulation of the data helped me get rid of this problem but a new problem has cropped up. I have grouped the data together and referenced the array as push(@{$variable[0]}, #some values);
But the value $variable is generated within the subroutine and i need to export this information to some other subroutine that is called by the user ( to plot the graph). As such, i was thinking of defining these arrays as global variables so that it can be easily accessed by the user without having to call the parent subroutine which generates these arrays(after first run). For eg: SubA generates these arrays. I need to call sub B(called by another subroutine C) that plots the graphs

Currently, i am able to generate the graphs within the same subroutine. I need to globalize these arrays.I cannot pass these arrays as arguments to sub C directly. My problem is with defining these dereferenced hashes(eg: @{$variable[0]}) within Sub A as global variables . How do i do that ???