#!/usr/bin/perl # Command to print "Hello world!" print "Hello world!\n"; $a = 1 + 2; # Add 1 and 2 and store in $a $a = 3 - 4; # Subtract 4 from 3 and store in $a $a = 5 * 6; # Multiply 5 and 6 $a = 7 / 8; # Divide 7 by 8 to give 0.875 $a = 9 ** 10; # Nine to the power of 10 $a = 5 % 2; # Remainder of 5 divided by 2 print ++$a, "\t"; # Increment $a and then return it print $a++, "\t"; # Return $a and then increment it print "$a\n"; print --$a, "\t"; # Decrement $a and then return it print $a--, "\t"; # Return $a and then decrement it print "$a\n"; $b = 'this'; $c = 'string'; $a = $b . $c; # Concatenate $b and $c print "$a\n"; $c = 3; $a = $b x $c; # $b repeated $c times print "$a\n"; # Compare: print 'this string\n'; # with: print "this string\n";