Thanks for everybody assistance, found a an appropiate solution to my problem. 
Without having to use the case statement.

Cheers

Paul



________________________________
 From: Hal Wigoda <hal.wig...@gmail.com>
To: beginners@perl.org 
Sent: Thursday, 2 August 2012 5:38 AM
Subject: Re: case statement in perl
 
so why don't they get rid of it?


On Wed, Aug 1, 2012 at 2:33 PM, Chris Nehren
<c.nehren/beginn...@shadowcat.co.uk> wrote:
> 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 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/



-- 
-----------------
Chicago
Hal Wigoda

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

Reply via email to