#!/usr/bin/perl -w use strict; printf("%03d\n", 5); printf("%03d\n", 12345); __END__ Prints: 005 12345