InMotion Web Site Hosting
InMotion Hosting Home




Node:Auto-Increment and Decrement, Next:, Previous:Comparison Operators, Up:Operators



Auto-Increment and Decrement

The auto-increment and auto-decrement operators in Perl work almost identically to the corresponding operators in C, C++, or Java. Here are few examples:

use strict;
my $abc = 5;
my $efg = $abc-- + 5;       # $abc is now 4, but $efg is 10
my $hij = ++$efg - --$abc;  # $efg is 11, $abc is 3, $hij is 8


InMotion Web Hosting Customer Support
M-F 8am - 7pm PST
213-239-0050

More information can be found at the InMotion Hosting Main Site