[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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

That's exactly right.

What I do know is that CGI.pm is pretty weird. In scalar context if a
param is not set param() returns undef. In array context if a param is
not set param() returns *an empty array*.

That's right, and it's the Perl way. In both cases, (undef and empty array), the result evaluates to false. If it returned a one-element array, then that would evaluate to one, which is true.

xoxo,
Andy

--
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance