Hey, look!  A Perl Thread!

What suprised you about Perl?  What was a little quirk that you didn't 
expect?  You might want to share with the list so we can all learn from 
one another's mistakes.

Up first, something lifted off of irc.

As we were discussing on IRC, "=>" (the 'fat comma') doesn't imply array 
context to it's right hand side argument, and CGI's param method does odd 
things in list context (it returns *all* parameters of that name.)  So:

   my $foo = { delete => $cgi->param("delete") };

May not do what you think, especially if someone went 

   foo.cgi?delete=1;delete=filename;delete=/etc/shadow

Now $foo contains;

   {
     delete => 1,
     what   => "/etc/shadow/"
   }

Erk!  Now your turn.

Later.

Mark.

-- 
s''  Mark Fowler                                     London.pm   Bath.pm
     http://www.twoshortplanks.com/              [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}



Reply via email to