diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-03 15:03:46 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-03 15:03:46 +0000 |
commit | de4864e4e7ced178416488fa2591227064c3222d (patch) | |
tree | f321dcff676073bbabdd24fce7b8af6e753ca4a4 /pod/perldiag.pod | |
parent | 936edb8bce14c9708bc6198559047de5d7e6af47 (diff) | |
download | perl-de4864e4e7ced178416488fa2591227064c3222d.tar.gz |
Change the push/unshift warning (#9532) to talk about "no values"
instead of "no arguments".
p4raw-id: //depot/perl@9534
Diffstat (limited to 'pod/perldiag.pod')
-rw-r--r-- | pod/perldiag.pod | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 16b4ec2adc..038b93fe59 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -3682,6 +3682,15 @@ L<perlref> for more on this. (W) You did C<use re;> without any arguments. That isn't very useful. +=item Useless use of %s with no values + +(W misc) You used the push() or unshift() function with no arguments +apart from the array, like C<push(@x)> or C<unshift(@foo)>. That won't +usually have any effect on the array, so is completely useless. It's +possible in principle that push(@tied_array) could have some effect +if the array is tied to a class which implements a PUSH method. If so, +you can write it as C<push(@tied_array,())> to avoid this warning. + =item "use" not allowed in expression (F) The "use" keyword is recognized and executed at compile time, and @@ -3949,15 +3958,6 @@ which means that Perl 5 will try to call the subroutine when the assignment is executed, which is probably not what you want. (If it IS what you want, put an & in front.) -=item Useless use of %s with no arguments - -(W misc) You used the push() or unshift() function with no arguments -apart from the array, like C<push(@x)> or C<unshift(@foo)>. That won't -usually have any effect on the array, so is completely useless. It's -possible in principle that push(@tied_array) could have some effect -if the array is tied to a class which implements a PUSH method. If so, -you can write it as C<push(@tied_array,())> to avoid this warning. - =back =cut |