#!/usr/bin/env perl use utf8; use strict; use warnings; MAIN: { my $a = 326; my $b = -1; my $c = 2015; my $i1 = 65000; my $i2 = -2; my $i3 = 3261963; my $f1 = 3.1415926; my $f2 = 2.99792458e9; my $f3 = 1.234e-4; my $c1 = ord("A"); my $c2 = ord("B"); my $c3 = ord("C"); my $s1 = "Apples"; my $s2 = "and"; my $s3 = "Bananas"; my $b1 = 1; my $b2 = 0; printf("Decimals: \%d \%d \%d\n", $a, $b, $c); printf("Unsigned Decimals: \%u \%u \%u\n", $a, $b, $c); printf("Hexadecimals: \%#x \%#x \%#x\n", $a, $b, $c); printf("Long Decimals: \%d \%d \%d\n", $i1, $i2, $i3); printf("Long Hexadecimals: \%016x \%016x \%016x\n", $i1, $i2, $i3); printf("Fixed FP: \%f \%f \%f\n", $f1, $f2, $f3); printf("Exponential FP: \%e \%e \%e\n", $f1, $f2, $f3); printf("General FP: \%g \%g \%g\n", $f1, $f2, $f3); printf("General FP with precision: \%.2g \%.2g \%.2g\n", $f1, $f2, $f3); printf("Boolean: \%b \%b\n", $b1, $b2); printf("Character: \%c \%c \%c\n", $c1, $c2, $c3); printf("String: \%s \%s \%s\n", $s1, $s2, $s3); }