perldiag: Correct ‘length() used on %s’
authorFather Chrysostomos <sprout@cpan.org>
Sun, 23 Jun 2013 22:20:07 +0000 (15:20 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 23 Jun 2013 23:12:28 +0000 (16:12 -0700)
op.c
pod/perldiag.pod
t/porting/diag.t

diff --git a/op.c b/op.c
index 6be3114..18b065c 100644 (file)
--- a/op.c
+++ b/op.c
@@ -10734,9 +10734,11 @@ Perl_ck_length(pTHX_ OP *o)
                     name, hash ? "keys " : "", name
                 );
             else if (hash)
+     /* diag_listed_as: length() used on %s (did you mean "scalar(%s)"?) */
                 Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                     "length() used on %%hash (did you mean \"scalar(keys %%hash)\"?)");
             else
+     /* diag_listed_as: length() used on %s (did you mean "scalar(%s)"?) */
                 Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                     "length() used on @array (did you mean \"scalar(@array)\"?)");
         }
index 17bea47..f4edbd4 100644 (file)
@@ -2712,7 +2712,7 @@ effective uids or gids failed.
 length/code combination tried to obtain more data.  This results in
 an undefined value for the length.  See L<perlfunc/pack>.
 
-=item length() used on %s
+=item length() used on %s (did you mean "scalar(%s)"?)
 
 (W syntax) You used length() on either an array or a hash when you
 probably wanted a count of the items.
index bafe346..56866e1 100644 (file)
@@ -511,9 +511,6 @@ Invalid type '%c' in unpack
 Invalid type ',' in %s
 ioctlsocket not implemented!
 killpg not implemented!
-length() used on %s (did you mean "scalar(%s)"?)
-length() used on %hash (did you mean "scalar(keys %hash)"?)
-length() used on @array (did you mean "scalar(@array)"?)
 List form of pipe open not implemented
 Malformed integer in [] in %s
 Malformed UTF-8 character (fatal)