Mega Code Archive

 
Categories / Perl / Language Basics
 

Increment and Decrement Operations

#! /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";