On Sun, Jun 18, 2017 at 11:41 PM, ToddAndMargo <toddandma...@zoho.com <mailto:toddandma...@zoho.com>> wrote:

    On 06/17/2017 12:22 AM, yary wrote:

        last if ++$true_count == 6;


    Hi Yary,

    ++$true_count

    Is that the same as `$true_count + 1` ?

    And does it alter the value of $true_count?

    -T





On 06/18/2017 09:50 PM, Stephen Wilcoxon wrote:
In this instance, it is the same as "$true_count = $true_count + 1".

++$var and $var++ differ if they are used in an assignment or other operation.

For instance:
my $x = 1;
my $y = ++$x;  # $x is incremented before assignment
my $z = $x++;  # $x is incremented after assignment

At the end, $x = 3, $y = 2, and $z = 2;



Thank you!

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to