The stupid question is the question not asked | |
PerlMonks |
Re^2: Why is this script giving syntax errors?by Old_Gray_Bear (Bishop) |
on Nov 02, 2013 at 21:00 UTC ( [id://1060978]=note: print w/replies, xml ) | Need Help?? |
kenosis said:
Since close FILE is the last statement in the second script, the ; is optional.The semi-colon is only option if it's omitted from the last line of your code. As the OP pointed out, the last line of the code doesn't stay that way for very long; there is always one more subroutine to be added. I view the 'optional' semi-colon the same way I view the 'optional' comma on the last item of a list. I just know that I'll want to add something else later, and since the Perl compiler is forgiving, I just add it automatically. Nota Bene: Just because I know that some particular piece of punctuation is optional (in the sense that the Compiler does the right thing if it is present or absent) doesn't automatically mean that I will remember when I am debugging a problem at O'Dark-Hundred with the entire site down. Don't leave land-mines lying around for the next person to stumble over two years later, it may be you....
Update =====
---- I Go Back to Sleep, Now. OGB
In Section
Seekers of Perl Wisdom
|
|