in reply to Re^2: The behavior when assigning an array to scalar?
in thread The behavior when assigning an array to scalar?

Re: precedence... wow.. so perl is different than C in that case? Thought for sure C took the right most element and that perl was designed to follow C precedence rules. hmmm...I should probably go test a C case now...
  • Comment on Re^3: The behavior when assigning an array to scalar?

Replies are listed 'Best First'.
Re^4: The behavior when assigning an array to scalar?
by choroba (Cardinal) on Sep 27, 2017 at 20:29 UTC
    C doesn't have context, but the behaviour of comma is very similar to Perl:
    #include <stdio.h> int main () { int i; i=1,2,3; printf("%d\n", i); i=(1,2,3); printf("%d\n", i); return 0; }

    Update: more similar example chosen.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,