![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Undefined Subroutineby arturo (Vicar) |
on May 21, 2003 at 01:57 UTC ( #259625=note: print w/replies, xml ) | Need Help?? |
What the other fine monks hath said, plus the following: if you've got a simple list of variable size, you should be thinking "array." It's much less error-prone to let the program do your repetition for you, instead of manually typing in every line. For all we know, you left off a ; or a quote in one of those lines, or the line you've added (re-emphasize the 'for all we know' part =) and that's the source of your trouble. Compare:
Now of course that forces you to set up the array beforehand, but that's not very difficult either:
Anyhow, just a kind of general programming note for the future, a good way of reducing bugs is to let the computer repeat stuff for you instead of doing it yourself. HTH If not P, what? Q maybe?
In Section
Seekers of Perl Wisdom
|
|