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.
uri
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/