Cool/useful short examples of Perl?

David Precious davidp at
Mon May 30 17:30:24 BST 2011

On Monday 30 May 2011 16:27:30 Denny wrote:
> On Mon, 2011-05-30 at 15:36 +0100, David Precious wrote:
> >     if (! Email::Valid->address($email_address) ) {
> Something wrong with 'unless'?

Depends whether you follow Damian Conway's PBP strictly :)

At $work, we mostly do follow PBP, but with some exceptions - avoiding unless 
is one of the bits we ignore when it makes code clearer.

In this case, however, we're talking bits of code for people who are just 
learning Perl, and "unless" might be somewhat new to them still; if they're 
coming from another language, "if" is probably going to be more familiar and 
easier to mentally parse, I'd imagine.

David Precious  ("bigpresh")

   "Programming is like sex. One mistake and you have to support
   it for the rest of your life". (Michael Sinz)

More information about the mailing list