On Wed, Aug 01, 2012 at 12:02:04 -0400 , Uri Guttman wrote:
> On 08/01/2012 03:08 AM, Paul.G wrote:
> >The example below is just a test, I need to be able to insert
> >multiple values into a command, those values can be either 1, 2 or
> >upto 5.
> >
> >
> you aren't getting the issue. the switch module was a major mistake
> and no one should be using it. you have to understand the downside to
> source filtering. no module can properly filter perl code as it is
> too subtle and complex to do so automatically. so source filters can
> seem to work now and if you do some changes to your code (not even
> near the switch stuff), it could break and you will have a hell of a
> time fixing it. the downside of that nasty hard to find bug is never
> worth it even if switch.pm appeals to you. modern perl's have a
> builtin given/when statement, you can use dispatch tables (especially
> for a fixed list of numbers or tokens) and other methods too. just
> avoid using the switch module. there is no way you can defend its use
> given the extremely nasty possible bugs it can introduce.

+1

Though given/when is too smart for its own good, I agree with everything
here.  When uri and I agree on something, it's a strong indicator to pay
attention.

-- 
Chris Nehren           | Coder, Sysadmin, Masochist
Shadowcat Systems Ltd. | http://shadowcat.co.uk/

Attachment: pgpWgsnYFeliD.pgp
Description: PGP signature

Reply via email to