Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perlop docs for seek() and sysseek() favor hardcoded constants over Fcntl #14760

Open
p5pRT opened this issue Jun 16, 2015 · 4 comments
Open

Comments

@p5pRT
Copy link

p5pRT commented Jun 16, 2015

Migrated from rt.perl.org#125422 (status was 'open')

Searchable as RT125422$

@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2015

From @ribasushi

The way the corresponding document is worded it almost sounds like using
Fcntl​::Seek_* is discouraged. Is this the case, and if so - why?

@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2015

From @jkeenan

On Tue Jun 16 08​:19​:08 2015, ribasushi@​cpan.org wrote​:

The way the corresponding document is worded it almost sounds like using
Fcntl​::Seek_* is discouraged. Is this the case, and if so - why?

Let me stipulate up front​: This is not an area of expertise for me.

That being said, I don't see where, in either 'perldoc -f seek' or 'perldoc -f sysseek', the use of the SEEK_* symbols from Fcntl is being discouraged.

In fact, when I say, 'perldoc Fcntl', I am led right back to those parts of 'perlfunc'​:

#####
For ease of use also the SEEK_* constants (for seek() and sysseek(),
e.g. SEEK_END) and the S_I* constants (for chmod() and stat()) are
available for import. They can be imported either separately or using
the tags C<​:seek> and C<​:mode>.
...
See L<perlfunc/seek> and L<perlfunc/sysseek> about the SEEK_* constants.
#####

So I'm ... confused.

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jun 17, 2015

From @tonycoz

On Tue Jun 16 15​:46​:30 2015, jkeenan wrote​:

On Tue Jun 16 08​:19​:08 2015, ribasushi@​cpan.org wrote​:

The way the corresponding document is worded it almost sounds like
using
Fcntl​::Seek_* is discouraged. Is this the case, and if so - why?

Let me stipulate up front​: This is not an area of expertise for me.

That being said, I don't see where, in either 'perldoc -f seek' or
'perldoc -f sysseek', the use of the SEEK_* symbols from Fcntl is
being discouraged.

In fact, when I say, 'perldoc Fcntl', I am led right back to those
parts of 'perlfunc'​:

#####
For ease of use also the SEEK_* constants (for seek() and sysseek(),
e.g. SEEK_END) and the S_I* constants (for chmod() and stat()) are
available for import. They can be imported either separately or using
the tags C<​:seek> and C<​:mode>.
...
See L<perlfunc/seek> and L<perlfunc/sysseek> about the SEEK_*
constants.
#####

All of the examples for seek() use the literals instead of the symbolic names.

Personally, I always use the symbols.

Tony

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants