use warnings; use subs qw(non_commutative); #necessary $x = 10 * non_commutative; $y = non_commutative * 10; print "$x\n$y\n\n"; $x = 10 + non_commutative; $y = non_commutative + 10; print "$x\n$y\n"; sub non_commutative {return 17} __END__ Outputs: 170 17 27 17