Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re^4: multiple-pass search?
in thread multiple-pass search?

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.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139550]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-18 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found