in reply to Solicitation For Ideas: Tutorial On Precedence

Something that continues to blow sand in my gears is print, in conjunction with the dot operator, and lists that I mistakenly treat as scalars. I think this has something to do with precedence of the dot operator, so perhaps this could be touched on. Where *is* the dot operator documented, anyway?

See Yet another List Versus Scalar Context Meditation

  • Comment on Re: Solicitation For Ideas: Tutorial On Precedence

Replies are listed 'Best First'.
Re^2: Solicitation For Ideas: Tutorial On Precedence
by Anonymous Monk on Feb 16, 2005 at 11:58 UTC
    From the perlop manual page:
               left        terms and list operators (leftward)
               left        ->
               nonassoc    ++ --
               right       **
               right       ! ~ \ and unary + and -
               left        =~ !~
               left        * / % x
               left        + - .
               left        << >>
               nonassoc    named unary operators
               nonassoc    < > <= >= lt gt le ge
               nonassoc    == != <=> eq ne cmp
               left        &
               left        | ^
               left        &&
               left        ||
               nonassoc    ..  ...
               right       ?:
               right       = += -= *= etc.
               left        , =>
               nonassoc    list operators (rightward)
               right       not
               left        and
               left        or xor
    
    (Eigth line, marked in red). And further down:
           Additive Operators
    
           Binary "+" returns the sum of two numbers.
    
           Binary "-" returns the difference of two numbers.
    
           Binary "." concatenates two strings.