Skip to content

Instantly share code, notes, and snippets.

Created November 14, 2010 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/676143 to your computer and use it in GitHub Desktop.
Save anonymous/676143 to your computer and use it in GitHub Desktop.
use v6;
sub center (*@lines) {
my $maxlen = [max] @lines».chars;
return @lines.map: { " " x ($maxlen - $_.chars) / 2 ~ $_ };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment