in reply to Re: Need explanation for subtle difference
in thread Need explanatiin for subtle difference
... evaluates its left argument, throws that value away, then evaluates its right argument and returns that value.
McA: As e.g.:
Note the Useless use of ... warnings for the variable and constant as these are evaluated and thrown away. Perl understands that the evaluation of a subroutine may have (useful) side-effects.c:\@Work\Perl\monks>perl -wMstrict -le "sub foo { print 'hi from foo()'; } my $bar = 42; ;; my $agent = (foo(), $bar, 666, 99); print qq{agent $agent}; " Useless use of private variable in void context at -e line 1. Useless use of a constant (666) in void context at -e line 1. hi from foo() agent 99
Give a man a fish: <%-(-(-(-<
|
---|