in reply to RE: Yet Another Cargo Cult non-use of CGI.pm
in thread Upload Security (strip ../, etc.)

Yeah, it breaks it with respect to vertical bars. My worry is that someone will copy that code without understanding, and either remove that line, or not understand the meaning of the vertical bar. (And splitting on vertical bars seems to be the one thing that beginners seem to constantly get wrong on the first few tries.)

CGI::param gets it right. In a scalar context, you get back the first one seen. In a list context, you get them all. No confusion for either kind of user.

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: RE: Yet Another Cargo Cult non-use of CGI.pm