Hi; On Tue, Apr 13, 2010 at 19:54, Uri Guttman <[email protected]> wrote: >>>>>> "JG" == Jim Gibson <[email protected]> writes: > > JG> On 4/13/10 Tue Apr 13, 2010 4:35 PM, "Mimi Cafe" > <[email protected]> > JG> scribbled: > > >> I think this will work, but is it elegant.? > > JG> Yes, it will work, and yes, it is elegant, as long as it encapsulates the > JG> logic that is required by your program. > > i disagree that it is elegant. too often if/else lists are not > needed. many can be replaced by dispatch tables. if one of the clauses > does just a return or next/last that can be replaced with a modifier or > shorter statement. without ANY serious work, i have over 10k lines of > perl code in one system with about 10 else's and maybe 3 elsif's. it > just is a matter of knowing how to manage flow control well and you > rarely need else's. > > uri
I really like the switch statement (native in Perl v5.10) over anything more complicated than one if/else clause. Ken Wolcott -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
