Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^5: multiple-pass search?by Fletch (Bishop) |
on Dec 10, 2021 at 13:54 UTC ( [id://11139550]=note: print w/replies, xml ) | Need Help?? |
However, I am searching in a directory in which there are only . . . Famous last words . . . :) Which is of course why he's pointing out that you've effectively made that assumption but not implemented it in your code and hence your code is vulnerable to things changing. If you're not going to add anchors you'd probably at the least want to add some sort of comments to this effect about the expectation(s) and mentioning when it can fail. Down the road in n months/years the person fixing the inevitable failure (either future-you or some successor) has something to go on then. We'll all cut corners like this at times (see Laziness and Impatience), it just sometimes helps to make it obvious for when they grow pointy again for whatever reason (and your Hubris can gloat that you foresaw this very problem).
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|