in reply to Re: Perl precedence details
in thread Perl precedence details

First, I've read perlop, thank you :)

Second, guess, You are wrong, it's not built in function:

use 5.010; use strict; sub mysub($) { printf "Sub called with %s\n", join '', @_; } sub mysub2 { printf "Sub2 called with %s\n", join '', @_; } mysub "test" eq "test"; mysub2 "test" eq "test";
mysub behaves like named unary op (because of proto i belive) and mysub2 behaves like list operator without parens.

Again, I need 100% sure explanation (not guesses) and point where I can find the list of named unary built ins without digging all the perldocs.

Replies are listed 'Best First'.
Re^3: Perl precedence details
by Athanasius (Archbishop) on Jun 20, 2015 at 13:46 UTC
    Second, guess, You are wrong, it's not built in function:

    Well, yes, you’re right, it’s not only a built-in function, it’s any function, built-in or user-defined, that has a ($) prototype.

    The Camel Book (4th Edition, 2012) has a table listing “all the named unary operators” on page 106. After 88 built-ins, the final entry is:

    any ($) sub

    Hope that helps,

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,