Mega Code Archive

 
Categories / Perl / String
 

%3d specifies that the integer number should be displayed with three digits

#!/usr/bin/perl -w $x = 123; $y = 1234; $z = 1; printf("\t x=%3d y=%4d z=%5d\n", $x, $y, $z);