Syntactic Confectionery Delight | |
PerlMonks |
Re: Perplexed Winemaking Monkby Russ (Deacon) |
on Aug 24, 2000 at 02:56 UTC ( [id://29351]=note: print w/replies, xml ) | Need Help?? |
Since you described this as your first Perl program, let me
comment on your loop. The others have given good advice
for the data structures, so I'll just make a quick suggestion
about your actual code.
You have:
In other words, for each index in @combo (the 0 .. $#combo part), set $Idx to that index and run the body of the block. This accomplishes the same thing as your code, but doesn't leave an unused variable ($n) lying around. It specifically uses the index of each element in @combo, which makes the code easier to follow and maintain. Besides, it looks so much cooler... ;-) Welcome to Perl in general and Perl Monks in specific. We're glad to have you. Russ
In Section
Seekers of Perl Wisdom
|
|