Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: The behavior when assigning an array to scalar?

by perl-diddler (Chaplain)
on Sep 27, 2017 at 14:59 UTC ( [id://1200203]=note: print w/replies, xml ) Need Help??


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,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1200203]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-16 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found