#!/usr/bin/perl use strict; my $x1 = 1; my $x2 = 1; print "\$x1 starts as $x1 and \$x2 starts as $x2.\n"; # method 1 if ($x1++) { if ($x2++) { print "We incremented \$x1 to $x1 and \$x2 to $x2.\n"; } } undef $x1; undef $x2; print "Undefine them both...\n"; #method 2 if ($x1++ && $x2++){ print "Shouldn't ever get here!\n"; } print "Now, we incremented \$x1 to '$x1' and \$x2 is still '$x2'.\n";