That is true, as I am aware of (see my no-pun remark above). I still put them there, to a) mark the end of a package in an easily readable way (yes, I want that in addition to a new package declaration), and b) so I won't forget it if I decide to move it to a separate file. Cargo Cult or no, I see no error in that practice, at least not for those reasons?
But it is ok to point that difference out, of course.
You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue. | [reply] [d/l] |
Cargo Cult practices are very rarely "wrong" in the sense of causing bad results. More often they are, like this one, just plain unnecessary. Instead of a cryptic "1;" you could write "# end of package Foo::Bar." And if you're worried about forgetting the "1;" when you move the package to a new file, well, don't. Perl will be happy to remind you when you try to load the new file!
-sam
| [reply] |
Sorry to keep this going, but I do not see what the win would be by doing it your way. Maybe it fulfills some way of doing it that some guru has claimed is the best (yes, I remember the debate over Cargo Cult programming). I don't say it is bad doing it your way, I don't see what the big deal is actually.
Using "1;" is as readable as a comment to me and most others - actually, you could think of it as one if you wish? Or is comments just plain unnecessary too (I mean, perl will run without them)? Sorry about that sarcasm, but it really looks like "Cargo Cult" is used as a buzzword this time (again).
Again, sorry to keep the discussion alive like this.
You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.
| [reply] |
__END__
Anything past that is treated as a comment. | [reply] |