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

[PATCH] Typo in perlsub.pod #17129

Closed
p5pRT opened this issue Aug 15, 2019 · 14 comments
Closed

[PATCH] Typo in perlsub.pod #17129

p5pRT opened this issue Aug 15, 2019 · 14 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 15, 2019

Migrated from rt.perl.org#134365 (status was 'pending release')

Searchable as RT134365$

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

From Valeriy.Kireev@Tune-IT.Ru

Created by Valeriy.Kireev@Tune-IT.Ru

There is small typo in pod/perlsub.pod, "IIF" used instead of "if". The patch
fixes it.

Perl Info

Flags:
    category=docs
    severity=low
    Type=Patch
    PatchStatus=HasPatch

Site configuration information for perl 5.31.3:

Configured by kk at Thu Aug 15 16:39:14 MSK 2019.

Summary of my perl5 (revision 5 version 31 subversion 3) configuration:
  Derived from: f0f66070bdc4000b714fbde4c050eb27569b795b
  Platform:
    osname=linux
    osvers=4.19.0-5-amd64
    archname=x86_64-linux
    uname='linux debauch 4.19.0-5-amd64 #1 smp debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 gnulinux '
    config_args='-des -Dusedevel'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='8.3.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.28.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.28'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Locally applied patches:
    uncommitted-changes


@INC for perl 5.31.3:
    lib
    /home/kk/perl5/lib/perl5
    /home/kk/perl5/lib/perl5
    /usr/local/lib/perl5/site_perl/5.31.3/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.31.3
    /usr/local/lib/perl5/5.31.3/x86_64-linux
    /usr/local/lib/perl5/5.31.3


Environment for perl 5.31.3:
    HOME=/home/kk
    LANG=en_US.UTF-8
    LANGUAGE=en_US:en
    LC_ALL=en_US.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/kk/perl5/bin:/home/kk/bin:/home/kk/perl5/bin:/home/kk/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    PERL5LIB=/home/kk/perl5/lib/perl5:/home/kk/perl5/lib/perl5
    PERL_BADLANG (unset)
    PERL_LOCAL_LIB_ROOT=/home/kk/perl5:/home/kk/perl5
    PERL_MB_OPT=--install_base "/home/kk/perl5"
    PERL_MM_OPT=INSTALL_BASE=/home/kk/perl5
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

From Valeriy.Kireev@Tune-IT.Ru

0001-Fix-typo-in-perlsub.pod.patch
From 87896f8d8352e11c8525be96f3c4e573c8240b89 Mon Sep 17 00:00:00 2001
From: Valeriy Kireev <kk@tune-it.ru>
Date: Thu, 15 Aug 2019 17:21:33 +0300
Subject: [PATCH] Fix typo in perlsub.pod

---
 pod/perlsub.pod | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pod/perlsub.pod b/pod/perlsub.pod
index 4571cbcc21..829e486ee7 100644
--- a/pod/perlsub.pod
+++ b/pod/perlsub.pod
@@ -224,7 +224,7 @@ X<recursion>
     &foo();		# the same
 
     &foo;		# foo() get current args, like foo(@_) !!
-    foo;		# like foo() IFF sub foo predeclared, else "foo"
+    foo;		# like foo() if sub foo predeclared, else "foo"
 
 Not only does the C<&> form make the argument list optional, it also
 disables any prototype checking on arguments you do provide.  This
-- 
2.20.1

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

From @jkeenan

On Thu, 15 Aug 2019 16​:02​:45 GMT, Valeriy.Kireev@​Tune-IT.Ru wrote​:

This is a bug report for perl from Valeriy.Kireev@​Tune-IT.Ru,
generated with the help of perlbug 1.41 running under perl 5.31.3.

-----------------------------------------------------------------
[Please describe your issue here]
There is small typo in pod/perlsub.pod, "IIF" used instead of "if".
The patch
fixes it.

There are places in the Perl 5 core distribution (and elsewhere in the tech world) where the string "IFF" means "if and only if".

Could this be one of those places? If so, then we would not apply the patch.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

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

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

From @Grinnz

On Thu, 15 Aug 2019 09​:23​:33 -0700, jkeenan wrote​:

On Thu, 15 Aug 2019 16​:02​:45 GMT, Valeriy.Kireev@​Tune-IT.Ru wrote​:

This is a bug report for perl from Valeriy.Kireev@​Tune-IT.Ru,
generated with the help of perlbug 1.41 running under perl 5.31.3.

-----------------------------------------------------------------
[Please describe your issue here]
There is small typo in pod/perlsub.pod, "IIF" used instead of "if".
The patch
fixes it.

There are places in the Perl 5 core distribution (and elsewhere in the
tech world) where the string "IFF" means "if and only if".

Could this be one of those places? If so, then we would not apply the
patch.

Thank you very much.

Yes, I think this is correct.

@p5pRT
Copy link
Author

p5pRT commented Aug 15, 2019

From @jkeenan

On Thu, 15 Aug 2019 16​:31​:06 GMT, grinnz@​gmail.com wrote​:

On Thu, 15 Aug 2019 09​:23​:33 -0700, jkeenan wrote​:

On Thu, 15 Aug 2019 16​:02​:45 GMT, Valeriy.Kireev@​Tune-IT.Ru wrote​:

This is a bug report for perl from Valeriy.Kireev@​Tune-IT.Ru,
generated with the help of perlbug 1.41 running under perl 5.31.3.

-----------------------------------------------------------------
[Please describe your issue here]
There is small typo in pod/perlsub.pod, "IIF" used instead of "if".
The patch
fixes it.

There are places in the Perl 5 core distribution (and elsewhere in the
tech world) where the string "IFF" means "if and only if".

Could this be one of those places? If so, then we would not apply the
patch.

Thank you very much.

Yes, I think this is correct.

Okay, given that at least one user found the documentation confusing, and given the fact that I had to ack the repository to locate other instances of 'IFF' to confirm my hunch, then I think we can conclude that the documentation is sub-optimal ... even though it's been there since perl-5.4 in 1997.

The longer I stare at it, the more I feel I don't know what the 'else "foo"' part means.

If I knew what 'else "foo"' meant, I'd work that into a rewording something like this​:

#####
foo; # if and only if sub foo has been predeclared,
  # then this is like foo() above
  # otherwise, _______
#####
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 16, 2019

From Valeriy.Kireev@Tune-IT.Ru

I didn't know about "IFF" abbreviation. So, I suppose, this misunderstanding is
my mistake, thus there is no need to clean up code base of IFFs.

On 8/15/19 10​:45 PM, James E Keenan via RT wrote​:

On Thu, 15 Aug 2019 16​:31​:06 GMT, grinnz@​gmail.com wrote​:

On Thu, 15 Aug 2019 09​:23​:33 -0700, jkeenan wrote​:

On Thu, 15 Aug 2019 16​:02​:45 GMT, Valeriy.Kireev@​Tune-IT.Ru wrote​:

This is a bug report for perl from Valeriy.Kireev@​Tune-IT.Ru,
generated with the help of perlbug 1.41 running under perl 5.31.3.

-----------------------------------------------------------------
[Please describe your issue here]
There is small typo in pod/perlsub.pod, "IIF" used instead of "if".
The patch
fixes it.

There are places in the Perl 5 core distribution (and elsewhere in the
tech world) where the string "IFF" means "if and only if".

Could this be one of those places? If so, then we would not apply the
patch.

Thank you very much.

Yes, I think this is correct.

Okay, given that at least one user found the documentation confusing, and given the fact that I had to ack the repository to locate other instances of 'IFF' to confirm my hunch, then I think we can conclude that the documentation is sub-optimal ... even though it's been there since perl-5.4 in 1997.

The longer I stare at it, the more I feel I don't know what the 'else "foo"' part means.

If I knew what 'else "foo"' meant, I'd work that into a rewording something like this​:

#####
foo; # if and only if sub foo has been predeclared,
# then this is like foo() above
# otherwise, _______
#####

--
Kind regards,
Valeriy Kireev
Software developer -- TuneIT Company.

@p5pRT
Copy link
Author

p5pRT commented Aug 16, 2019

From @khwilliamson

On 8/16/19 3​:55 AM, Valeriy Kireev wrote​:

I didn't know about "IFF" abbreviation. So, I suppose, this
misunderstanding is my mistake, thus there is no need to clean up code
base of IFFs.

On 8/15/19 10​:45 PM, James E Keenan via RT wrote​:

On Thu, 15 Aug 2019 16​:31​:06 GMT, grinnz@​gmail.com wrote​:

On Thu, 15 Aug 2019 09​:23​:33 -0700, jkeenan wrote​:

On Thu, 15 Aug 2019 16​:02​:45 GMT, Valeriy.Kireev@​Tune-IT.Ru wrote​:

This is a bug report for perl from Valeriy.Kireev@​Tune-IT.Ru,
generated with the help of perlbug 1.41 running under perl 5.31.3.

-----------------------------------------------------------------
[Please describe your issue here]
There is small typo in pod/perlsub.pod, "IIF" used instead of "if".
The patch
fixes it.

There are places in the Perl 5 core distribution (and elsewhere in the
tech world) where the string "IFF" means "if and only if".

Could this be one of those places?  If so, then we would not apply the
patch.

Thank you very much.

Yes, I think this is correct.

Okay, given that at least one user found the documentation confusing,
and given the fact that I had to ack the repository to locate other
instances of 'IFF' to confirm my hunch, then I think we can conclude
that the documentation is sub-optimal ... even though it's been there
since perl-5.4 in 1997.

I agree. I have, BTW, never seen iff expressed in caps before. Since
my undergrad degree is in mathematics, it would be just part of the text
to me without slowing me down when perusing text that contains it. But,
I would have to stop and think about IFF. So I think it's worth changing.

The longer I stare at it, the more I feel I don't know what the 'else
"foo"' part means.

If I knew what 'else "foo"' meant, I'd work that into a rewording
something like this​:

#####
foo;        # if and only if sub foo has been predeclared,
             # then this is like foo() above
             # otherwise, _______
#####

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 2019

From @jkeenan

On Fri, 16 Aug 2019 17​:04​:34 GMT, public@​khwilliamson.com wrote​:

On 8/16/19 3​:55 AM, Valeriy Kireev wrote​:

I didn't know about "IFF" abbreviation. So, I suppose, this
misunderstanding is my mistake, thus there is no need to clean up code
base of IFFs.

On 8/15/19 10​:45 PM, James E Keenan via RT wrote​:

On Thu, 15 Aug 2019 16​:31​:06 GMT, grinnz@​gmail.com wrote​:

On Thu, 15 Aug 2019 09​:23​:33 -0700, jkeenan wrote​:

On Thu, 15 Aug 2019 16​:02​:45 GMT, Valeriy.Kireev@​Tune-IT.Ru wrote​:

This is a bug report for perl from Valeriy.Kireev@​Tune-IT.Ru,
generated with the help of perlbug 1.41 running under perl 5.31.3.

-----------------------------------------------------------------
[Please describe your issue here]
There is small typo in pod/perlsub.pod, "IIF" used instead of "if".
The patch
fixes it.

There are places in the Perl 5 core distribution (and elsewhere in the
tech world) where the string "IFF" means "if and only if".

Could this be one of those places?  If so, then we would not apply the
patch.

Thank you very much.

Yes, I think this is correct.

Okay, given that at least one user found the documentation confusing,
and given the fact that I had to ack the repository to locate other
instances of 'IFF' to confirm my hunch, then I think we can conclude
that the documentation is sub-optimal ... even though it's been there
since perl-5.4 in 1997.

I agree. I have, BTW, never seen iff expressed in caps before. Since
my undergrad degree is in mathematics, it would be just part of the text
to me without slowing me down when perusing text that contains it. But,
I would have to stop and think about IFF. So I think it's worth changing.

The longer I stare at it, the more I feel I don't know what the 'else
"foo"' part means.

If I knew what 'else "foo"' meant, I'd work that into a rewording
something like this​:

#####
foo;        # if and only if sub foo has been predeclared,
             # then this is like foo() above
             # otherwise, _______
#####

Okay. So, how would I fill in the blank after 'otherwise' above?

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

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 2019

From @Grinnz

On Mon, Aug 19, 2019 at 8​:28 AM James E Keenan via RT <
perlbug-followup@​perl.org> wrote​:

If I knew what 'else "foo"' meant, I'd work that into a rewording
something like this​:

#####
foo; # if and only if sub foo has been predeclared,
# then this is like foo() above
# otherwise, _______
#####

Okay. So, how would I fill in the blank after 'otherwise' above?

It means it is otherwise interpreted as a bareword string "foo", though I'm
not sure how relevant this is to point out in the era of strict 'subs'.

-Dan

@p5pRT
Copy link
Author

p5pRT commented Aug 27, 2019

From @tonycoz

On Mon, 19 Aug 2019 07​:11​:15 -0700, grinnz@​gmail.com wrote​:

On Mon, Aug 19, 2019 at 8​:28 AM James E Keenan via RT <
perlbug-followup@​perl.org> wrote​:

If I knew what 'else "foo"' meant, I'd work that into a rewording
something like this​:

#####
foo; # if and only if sub foo has been predeclared,
# then this is like foo() above
# otherwise, _______
#####

Okay. So, how would I fill in the blank after 'otherwise' above?

It means it is otherwise interpreted as a bareword string "foo", though I'm
not sure how relevant this is to point out in the era of strict 'subs'.

-Dan

Something like this?

Tony

@p5pRT
Copy link
Author

p5pRT commented Aug 27, 2019

From @tonycoz

0001-perl-134365-IFF-iff-and-talk-about-strict-a-bit.patch
From db00119e98b01091245710e1d20943e7d3fe3fff Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 27 Aug 2019 14:44:35 +1000
Subject: (perl #134365) IFF -> iff and talk about strict a bit

The IFF can be confusing, since "iff" for "if and only if" is
normally presented in lower case.

Since we really want people using strict, firstly tell users about
the behaviour under strict.
---
 pod/perlsub.pod | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pod/perlsub.pod b/pod/perlsub.pod
index 4571cbcc21..b5c05d274e 100644
--- a/pod/perlsub.pod
+++ b/pod/perlsub.pod
@@ -224,7 +224,12 @@ X<recursion>
     &foo();		# the same
 
     &foo;		# foo() get current args, like foo(@_) !!
-    foo;		# like foo() IFF sub foo predeclared, else "foo"
+    use strict 'subs';
+    foo;                # like foo() iff sub foo predeclared, else
+                        # a compile-time error
+    no strict 'subs';
+    foo;                # like foo() iff sub foo predeclared, else
+                        # a literal string "foo"
 
 Not only does the C<&> form make the argument list optional, it also
 disables any prototype checking on arguments you do provide.  This
-- 
2.11.0

@p5pRT
Copy link
Author

p5pRT commented Aug 30, 2019

From @khwilliamson

I applied Tony's patch

Thanks Valeriy for finding and reporting this, and your initial patch

--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Aug 30, 2019

@khwilliamson - Status changed from 'open' to 'pending release'

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

No branches or pull requests

1 participant