diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-06 00:10:40 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-06 00:10:40 +0000 |
commit | eb6e2d6f1e269264d7937d1be23cbbe0b6820902 (patch) | |
tree | 35c59e04b4db7af027ae8dd6addaada967b4b1b6 /pod | |
parent | 98627ae8f09f88a753760c651828da353f8c4989 (diff) | |
download | perl-eb6e2d6f1e269264d7937d1be23cbbe0b6820902.tar.gz |
optional warning on join(/foo/...) (reworked suggested patch
by Mark-Jason Dominus <mjd@plover.com>)
p4raw-id: //depot/perl@4083
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldelta.pod | 7 | ||||
-rw-r--r-- | pod/perldiag.pod | 7 | ||||
-rw-r--r-- | pod/perlfunc.pod | 3 |
3 files changed, 16 insertions, 1 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index a228530b07..cf975594bb 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -725,6 +725,13 @@ of a subroutine attribute, and it wasn't a semicolon or the start of a block. Perhaps you terminated the parameter list of the previous attribute too soon. +=item /%s/ should probably be written as "%s" + +(W) You have used a pattern where Perl expected to find a string, +like in the first argument to C<join>. Perl will treat the true +or false result of matching the pattern against $_ as the string, +which is probably not what you had in mind. + =head1 Obsolete Diagnostics Todo. diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 10808ff516..1c07a31fa6 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -112,6 +112,13 @@ your signed integers. See L<perlfunc/unpack>. by Perl. This combination appears in an interpolated variable or a C<'>-delimited regular expression. +=item /%s/ should probably be written as "%s" + +(W) You have used a pattern where Perl expected to find a string, +like in the first argument to C<join>. Perl will treat the true +or false result of matching the pattern against $_ as the string, +which is probably not what you had in mind. + =item %s (...) interpreted as function (W) You've run afoul of the rule that says that any list operator followed diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index d420059d4c..f830478d23 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2064,7 +2064,8 @@ separated by the value of EXPR, and returns that new string. Example: $rec = join(':', $login,$passwd,$uid,$gid,$gcos,$home,$shell); -See L</split>. +Beware that unlike C<split>, C<join> doesn't take a pattern as its +first argument. Compare L</split>. =item keys HASH |