[Omaha.pm] CGI.pm param() gotcha

Kenneth Thompson kthompson at omnihotels.com
Tue Oct 18 05:28:30 PDT 2005


Because the first way sends scalar references into the passed hashref,
and the second sends scalar values into the passed hashref?

-----Original Message-----
On Oct 17, 2005, at 10:38 PM, Jay Hannah wrote:
> 20 bonus points to anyone who can tell me why I made this change:

<   $res->set_address    (
<      address1     => $q->param('gst_addr1'),
<      address2     => $q->param('gst_addr2'),
<      address3     => $q->param('gst_addr3'),
<      city         => $q->param('gst_city'),
<      state        => $q->param('gst_state'),
<      postal       => $q->param('gst_zipcode'),
<      country_code => $q->param('gst_country_code'));
---
 >   $res->set_address    (
 >      address1     => scalar($q->param('gst_addr1')),
 >      address2     => scalar($q->param('gst_addr2')),
 >      address3     => scalar($q->param('gst_addr3')),
 >      city         => scalar($q->param('gst_city')),
 >      state        => scalar($q->param('gst_state')),
 >      postal       => scalar($q->param('gst_zipcode')),
 >      country_code => scalar($q->param('gst_country_code')));



More information about the Omaha-pm mailing list