This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #134365) IFF -> iff and talk about strict a bit
authorTony Cook <tony@develop-help.com>
Tue, 27 Aug 2019 04:44:35 +0000 (14:44 +1000)
committerKarl Williamson <khw@cpan.org>
Fri, 30 Aug 2019 14:44:28 +0000 (08:44 -0600)
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

index 4571cbc..b5c05d2 100644 (file)
@@ -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