Skip to content

Instantly share code, notes, and snippets.

@notbenh
Created February 13, 2013 18:48
Show Gist options
  • Save notbenh/4947067 to your computer and use it in GitHub Desktop.
Save notbenh/4947067 to your computer and use it in GitHub Desktop.
an example of how to padd out a string using x
#!/usr/bin/perl
use strict;
use warnings;
my $column_width = 7;
my $number = 15;
my $padded_number = '0' x ($column_width - length($number)) . $number;
print "|$padded_number|\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment