A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Perl sprintf

        # Format number with up to 8 leading zeroes
$result = sprintf("%08d", $number);
        # Round number to 3 digits after decimal point
$rounded = sprintf("%.3f", $number);

Perl's sprintf permits the following universally-known conversions:

   %% a percent sign
%c a character with the given number
%s a string
%d a signed integer, in decimal
%u an unsigned integer, in decimal
%o an unsigned integer, in octal
%x an unsigned integer, in hexadecimal
%e a floating-point number, in scientific notation
%f a floating-point number, in fixed decimal notation
%g a floating-point number, in %e or %f notation