laziness, impatience, and hubris | |
PerlMonks |
Re: Re: Re: creating an array of namesby jjdraco (Scribe) |
on Nov 11, 2002 at 18:13 UTC ( [id://212009]=note: print w/replies, xml ) | Need Help?? |
Well first I'll assume the $array[i] is a typo. second you don't seem to be reading through the array. $i is set to 0 and thats not 12 of course so you will loop through the while forever and depending on wether $month contains jan, since $i is the first element in the array it will print "yes it's a month\n" again,and again, and again......etc you could do it this way though I'm not sure if you're trying to find out if each element is a month or looking for one particular month. I just assumned you where looking for a particular month Update: replaced '=' with correct eq in if statement jjdraco learning Perl one statement at a time.
In Section
Seekers of Perl Wisdom
|
|