IIRC the PBP advises to omit parens when unambiguously calling built-ins, because (and I agree) it removes extra-noise and improves readability. Thus, CL#1 is written as it was and it runs OK.
Then, looking at CL#2, I thought to omit a pair of parens -- see CL#3. I don't see anything becoming ambiguous, but Perl is confused -- see CL#4. And why the uniq imposes numeric context?
Also curious, if I'm explicitly imposing numeric context on sort (CL#5), Perl warns me 6 times, and not 5, as with CL#3.
>perl -lwe "sub x{@_} print sort x( qw( q w e r t y ))" eqrtwy >perl -MList::Util=uniq -lwe "print sort( uniq( qw( q w e r t y )))" eqrtwy >perl -MList::Util=uniq -lwe "print sort uniq( qw( q w e r t y ))" Argument "w" isn't numeric in sort at -e line 1. Argument "r" isn't numeric in sort at -e line 1. Argument "y" isn't numeric in sort at -e line 1. Argument "e" isn't numeric in sort at -e line 1. Argument "t" isn't numeric in sort at -e line 1. qwerty >perl -MO=Deparse -MList::Util=uniq -lwe "print sort uniq( qw( q w e r + t y ))" BEGIN { $^W = 1; } BEGIN { $/ = "\n"; $\ = "\n"; } use List::Util (split(/,/, 'uniq', 0)); print((sort uniq 'q', 'w', 'e', 'r', 't', 'y')); -e syntax OK >perl -lwe "print sort {$a <=> $b} qw( q w e r t y )" Argument "q" isn't numeric in sort at -e line 1. Argument "w" isn't numeric in sort at -e line 1. Argument "e" isn't numeric in sort at -e line 1. Argument "r" isn't numeric in sort at -e line 1. Argument "t" isn't numeric in sort at -e line 1. Argument "y" isn't numeric in sort at -e line 1. qwerty
In reply to Perl parser gets confused with call to "sort" w/o parens by vr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |