[VPM] programmically create keys and vals for anonhash

Jer A jeremygwa at hotmail.com
Sun Feb 11 15:27:31 PST 2007


Darren is redirecting this to the list, as my own probe succeeded.
------------------

Hello Darren, I am resending you this message directly, as there is 
something wrong with the perl mailing-list.

-------------------
Hi All,

how do i programmically create a hash ref, without having to code the 
key and value pairs?
eg.  $data = {Key1 => $val1,Key2 => $val2,Key3 => $val3} ;
suppose I create an Array with key and value pairs,....the number of 
keys and values are only known at run time.
eg.
push(@HEADERS,{ KEYNAME => $1, KEYVAL => $2});

With the information in @HEADERS, how do I use this to create a 
hashref, with as many key/val pairs in the array, without manually 
coding it?

$data = { "KEY" => "VAL", ... etc };


Thanks in advance for your help.

-Jer A.


More information about the Victoria-pm mailing list