Updated: 10/02/2017 by Computer Hope

A decrement is a programming operator that decreases a numerical value of its operand by 1. In Perl, a variable can be decremented by one by adding a -- at the end of the variable. In the example below, the value variable is set as five and then decremented in value by one with the $value--; line. The last line prints the new value of the variable, which is four.

my $value = 5;
print "$value\n";

Increment, Operator, Programming terms