programming-examples/perl/Basics/Increment and Decrement Operations.pl
2019-11-18 14:44:36 +01:00

14 lines
370 B
Perl

#! /usr/local/bin/perl
$a=15;
$b = ++$a -15;
$c = $a++ - 15;
print "The increment operation occurs first on the left side\n";
print "$b = ++$a - 15 results in $b equal ";
print "$b\n";
print "The increment operation occurs after other operations when on the right side\n";
print "$c = $a- - 15 results in $c equal ";
print "$c\n";