Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • Downvote because your protoype causes the code to malfunction in a horrible horrible way. You should not use prototypes when you don't know exactly what they do, and even they there is absolutely no reason to use the prototype you just suggested. Commented Feb 16, 2009 at 10:41
  • If you supply an array as argument, it is evaluated in scalar context. Thus, only one value will be passed to the function: the length of the array. That is guaranteed to cause bugs. Commented Feb 16, 2009 at 10:52
  • I repeat, never use prototypes unless you really know what you're doing. And if you use $$$ prototypes, you don't know what you're doing. Commented Feb 16, 2009 at 10:54
  • Leon speaks the truth. Prototypes are only needed in Perl to handle certain arcane bits of deep magic. In everyday contexts, they are far more likely to do harm than good. Yet another way in which Perl Ain't C. Commented Feb 16, 2009 at 11:03
  • +1 for a nice simple function. But depending on the order of columns in your DB table makes this code very fragile. Commented Feb 17, 2009 at 11:34