[Techtalk] On Perl

jennyw jennyw at dangerousideas.com
Fri Jul 26 19:44:26 EST 2002


It's not bad code (although it'd be a lot easier to read with
indentation), given that it's a tutorial excercise and probably while and
if-elsif-else are the only control structures introduced so far.

Of course, one of Perl's mottos is "there's more than one way to do it".  
This is something Perl people love and others (e.g. Python people) hate.
;-) This means there are endless permutations on how you could have 
written the code, and some people will be more partial to some versions.

One obvious thing that you could do is to replace the if-elsif with a for 
loop (which I'm guessing hasn't been introduced yet). I'm assuming this is 
what Coldie is referring to as unecessary conditionals.  

Jen

On Fri, Jul 26, 2002 at 11:55:04AM -0700, gab wrote:
> Coldie,
> I'm curious as to what makes this poorly written.  I think that a better
> way to do something like this would be to use a hash instead of an
> array;  what else?
> 
> If this is going too OT for the Linuxchix list, please email me
> privately.  Thanks!
> 
> gabrielle, still a perl newbie after all these years.
> 
> 
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk
> 
> 



More information about the Techtalk mailing list