Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

RE: Re: order of evaluation of operands

by jlistf (Monk)
on Jul 21, 2000 at 21:00 UTC ( [id://23612]=note: print w/replies, xml ) Need Help??


in reply to Re: order of evaluation of operands
in thread order of evaluation of operands

That's why you can safely say: ($a,$b) = (shift, shift) to get the first two values from @_, IN THE RIGHT ORDER.
the comma operator is one that definitely evaluates left to right. it does this even in C/C++ (in addition to &&, and, ||, or and ?:). i know that those evaluate left to right. but are all operators guaranteed to evaluate left to right. just because your computer does it that way does not necesarily mean that all will. granted Perl has less computer/software dependant items like C and C++, but i'd like to know for sure what the case is. preferably some mention in documentation or an answer from someone who's read the source code or a link to a tutorial or something.

Replies are listed 'Best First'.
RE: RE: Re: order of evaluation of operands
by japhy (Canon) on Jul 21, 2000 at 21:57 UTC
    Check the perlop documentation.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found