On Fri, 14 Mar 2014 13:03:58 -0400, Ralph Grove wrote:
> I'm trying to determine how Perl evaluates operands for expressions. I
> expected the following code to output 3, 4, and 5, as it would if
> executed as a C++ or Java program. The actual output that I get
> (v5.16.2), however, is 4, 4, and 5.
Hi Uri (and all),
On Fri, 14 Mar 2014 13:40:02 -0400
Uri Guttman wrote:
> On 03/14/2014 01:03 PM, Ralph Grove wrote:
> > I'm trying to determine how Perl evaluates operands for expressions. I
> > expected the following code to output 3, 4, and 5, as it would if
> > executed as a C++ or Java prog
On Fri, Mar 14, 2014 at 6:03 PM, Ralph Grove wrote:
> I'm trying to determine how Perl evaluates operands for expressions. I
> expected the following code to output 3, 4, and 5, as it would if executed
> as a C++ or Java program. The actual output that I get (v5.16.2), however,
> is 4, 4, and 5.
Perlop:
...
Auto-increment and Auto-decrement
"++" and "--" work as in C. That is, if placed before a variable, they
increment or decrement the variable by one before returning the value, and if
placed after, increment or decrement after returning the value.
$i = 0; $j = 0;
print $i++;
On 03/14/2014 01:03 PM, Ralph Grove wrote:
I'm trying to determine how Perl evaluates operands for expressions. I
expected the following code to output 3, 4, and 5, as it would if
executed as a C++ or Java program. The actual output that I get
(v5.16.2), however, is 4, 4, and 5. This leads me to