BEGIN { @a = 10; @b = 5; printf("a + b = %d\n", @a + @b); } END { printf("a - b = %d\n", @a - @b); @c = @a + 2 * @b; printf("c = %d, total = %d\n", @c, (@c - @b) / 5); }