Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Seek, whence 0 or 1

by Hena (Friar)
on Jun 28, 2006 at 08:14 UTC ( [id://557964]=note: print w/replies, xml ) Need Help??


in reply to Re: Seek, whence 0 or 1
in thread Seek, whence 0 or 1

I can quess that it doesn't help much. Mainly I'm interested on what are others opinions on which of the two seek lines is better (and tell also why and on what better) in the example above.

Replies are listed 'Best First'.
Re^3: Seek, whence 0 or 1
by GrandFather (Saint) on Jun 28, 2006 at 08:34 UTC

    Applying the test "which is easier to read and maintain" compare:

    seek (INPUT, $last, 0)

    and:

    seek (INPUT, tell (INPUT) - $last, 1);

    then tell me which is easier to read and which is easier to maintain (is less complex)? For me the absolute seek is the winner by far.

    Drawing an analogy with the way people seek in a book is not particuarly helpful as a model for analysing the pros and cons of the two seek methods by the way. Personally I tend to flip through a book from the back (seek (fh, pos, 2)) then perform a binaryish search from approximately the right place. :)


    DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

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

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

    No recent polls found