The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
From the Text::Aligner documentation:


NAME
    Text::Aligner

SYNOPSIS
      use Text::Aligner qw( align);

      # Print the words "just a test!" right-justified each on a line:

      my @lines = align( 'right', qw( just a test!);
      print "$_\n" for @lines;

DESCRIPTION
    Text::Aligner exports a single function, align(), which is used to
    justify strings to various alignment styles. The alignment specification
    is the first argument, followed by any number of scalars which are
    subject to alignment.

    The operation depends on context. In list context, a list of the
    justified scalars is returned. In scalar context, the justified
    arguments are joined into a single string with newlines appended. The
    original arguments remain unchanged. In void context, in-place
    justification is attempted. In this case, all arguments must be lvalues.

    Align() also does one level of scalar dereferencing. That is, whenever
    one of the arguments is a scalar reference, the scalar pointed to is
    aligned instead. Other references are simply stringified. An undefined
    argument is interpreted as an empty string without complaint.