programming-examples/perl/_Basics/Increment and Decrement Operations.pl

14 lines
370 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#! /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";