#!/usr/bin/perl use strict; use warnings; my $x = 5; $x = $x + ++$x + $x++; print "x: $x\n"; my $y = 5; # avoid any contamination from first group. $y = ++$y + $y++ + $y; print "y: $y\n"; exit; __END__ Output: [~/perl/test]# ./prepost.pl x: 18 y: 20