On Thu, Dec 26, 2013 at 11:20 AM, Paul Graydon <p...@paulgraydon.co.uk>wrote:
> On Fri, Dec 20, 2013 at 10:45:05AM -0500, Brandon Allbery wrote: > > On Fri, Dec 20, 2013 at 10:39 AM, john boris <jbori...@gmail.com> > wrote: > > I have this perl script that I have a long if/elsif portion. I am > > porting a shell script to perl so I am trying to mimic a case > statement > > from a shell script. I know I should use Switch but the version > > > > Actually Switch is considered rather bad. > > I don't think I've heard that before.. why is switch considered bad? In > most languages it is supposed to be far more efficient than a nested if > statement. > Not switches in general, but the specific Perl module Switch is poorly implemented. Consider using Switch::Plain instead. (And *don't* use given/when in recent Perls; it uses smartmatching, an experimental feature that turned out to be a poor fit with Perl 5's lack of a type system and which is likely to change significantly in future releases.) -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Tech mailing list Tech@lists.lopsa.org https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech This list provided by the League of Professional System Administrators http://lopsa.org/