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


in reply to How do I get a reference to a subroutine return value?

I'm not too sure I understood the question, I assume you want to get all the CGI-Paramers into your subroutine like so: myfunc(return => query->param("return"), authors => query->param("authors"));

The short answer: myfunc(  map { $_ => [$query->param($_)] } $query->param()  );

the long answer:

Get a list of all the parameters with $query->param(). This will be fed into map.

Map can be used to apply some commands to every element in a list, and construct a new list from the result. In this case for every element you feed into the map, you get back two elements: you get back the key, and an anonymouse array with the values.

that's it -- Brigitte 'I never met a chocolate I didnt like' Jellinek http://www.horus.com/~bjelli/ http://perlwelt.horus.at