You seem to be not just passing an array, but passing an array of hashes. There may be a way that the wonderful wonderful CGI.pm handles this data structure, but if there is I don't know it. I would have thought it would be easier to break your data up into several name/value pairs, since that's what it is anyway, and save each pair in its own hidden variable.
I know it's not what you asked about, but could I offer some observations on your use of CGI.pm? I've only recently started using it, so I'm not a huge expert, but I'm enthusiastic to share what works for me.
I notice you import
:all the CGI functions, but you then go ahead and create a CGI object as well - that, I think, is redundant. For what you are doing I think it wd be simpler to stick with the function-oriented interface. Also, you don't need
:all the functions:
use CGI qw/:standard/; should suffice.
Then, having imported these functions (either explicitly, or implicitly by creating the CGI object) you might as well get your money's worth, and use them to create your html. To show how you could do that I've re-written
Header:
print
header,
start_html(-title => 'Pass the array'),
h1('Array:'),
(left off the last two lines since most times you'll get black text on white background by default). I think that's a lot easier to write and read, and it's also harder to get typos that can't be found but make a mess.
That probably makes it short enough that you might not put it in a subroutine. But if you do, it strikes me that it's asking for trouble to give that subroutine (almost) the same name as a function that you just imported from CGI.pm.
Sorry to go on about something you didn't ask about - hope some of it's useful.
§
George Sherston