in reply to Re: Global vs. local?
in thread Global vs. local?

Whoa! Don't.

If you tell people what not to use, also tell them what to use instead ;-)

here: perl 5.10 introduces given/when, see perl5100delta. Short example:

use 5.010; given ($value) { when (1) { ... } when (2) { ... } default { die "Don't know what to do with '$_'" } }

It's not needed here, because a closure is much better, but in general it's surely good to know.

Replies are listed 'Best First'.
Re^3: Global vs. local?
by jpavel (Sexton) on May 28, 2009 at 09:40 UTC
    Thanks, I'll make that change!