Message-ID: <
20011119132645.A15034@rafael>
p4raw-id: //depot/perl@13094
}
WITH_THR(PL_curcop = &PL_compiling);
break;
+ case OP_SORT:
+ if (ckWARN(WARN_VOID))
+ Perl_warner(aTHX_ WARN_VOID, "Useless use of sort in scalar context");
}
return o;
}
(W) You did C<use re;> without any arguments. That isn't very useful.
+=item Useless use of sort in scalar context
+
+(W void) You used sort in scalar context, as in :
+
+ my $x = sort @y;
+
+This is not very useful, and perl currently optimizes this away.
+
=item Useless use of %s with no values
(W syntax) You used the push() or unshift() function with no arguments
$a ;
"abc"
+ Useless use of sort in scalar context
+ my $x = sort (2,1,3);
+
Applying %s to %s will act on scalar(%s)
my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
@a =~ /abc/ ;
Useless use of getpwuid in void context at - line 53.
########
# op.c
+use warnings 'void' ; close STDIN ;
+my $x = sort (2,1,3);
+no warnings 'void' ;
+$x = sort (2,1,3);
+EXPECT
+Useless use of sort in scalar context at - line 3.
+########
+# op.c
no warnings 'void' ; close STDIN ;
1 x 3 ; # OP_REPEAT
# OP_GVSV