From: [EMAIL PROTECTED]
> Using perldoc -q tail
> leading to
> perldoc -f seek
> perldoc -f tell
> 
> I'm not getting how to use those functions.  Partly because what
> passes for examples in those docs doesn't use normal language, instead
> they use terms like WHENCE, something that's almost never used in
> normal language.  When WHERE would get the point across at a glance
> instead of having to dig into the details,

Sorry, WHERE would not cut it. FROM_WHERE would.
And without the "details" included in the "The values for WHENCE are 
0 to set the new position in bytes to POSITION, 1 to set it to the 
current position plus POSITION, and 2 to set it to EOF plus POSITION 
(typically negative)." sentence the docs would be useless no matter 
what you call that parameter.

> At first I took it to mean something more involved than giving a
> possition.
> No biggee I guess  but then I see:
> 
>                    for (;;) {
>                        for ($curpos = tell(FILE); $_ = <FILE>;
>                             $curpos = tell(FILE)) {
>                            # search for some stuff and put it into files
>                        }
>                        sleep($for_a_while);
>                        seek(FILE, $curpos, 0);
>                    }
> 
> Even here what the heck does `;;' mean.  This stuff is supposed to be
> readable by someone who doesn't know these things.  Even down to
> `curpos'.  I didn't get what it meant for a few seconds.  Why not
> spell it out... $CurrentPostion.  After all clarity is what we're
> after here.

That example was NOT supposed to show the normal use of seek(). It 
was an example of what you may have to do in a fairly specific 
situation spelled out a few lines above. Skipping lines while reading 
documentation is not always the best thing to do.

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to