diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-05 11:58:12 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-05 11:58:45 +0200 |
commit | 65f28d4079bae82a4bb94890989358b0339f7a62 (patch) | |
tree | 56c231c225345185542e52dae550f769cdc6b345 /bin | |
parent | f66d76f4414111f79dc73eb0f8b76f12741b4b81 (diff) |
checklinks: print_format: Use printf
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/checklinks | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/checklinks b/bin/checklinks index fee8814..1ac0953 100755 --- a/bin/checklinks +++ b/bin/checklinks @@ -1,5 +1,5 @@ #!/usr/bin/env perl -## Copyright (C) 2008 by Daniel Friesel <derf@derf.homelinux.org> +## Copyright © 2008-2009 by Daniel Friesel <derf@derf.homelinux.org> ## License: WTFPL <http://sam.zoy.org/wtfpl> use strict; use warnings; @@ -122,15 +122,12 @@ sub mkdirs { sub print_format { my ($message, $src, $dst, $color) = @_; - $message .= ' 'x(9-length($message)); - $src .= ' 'x(15-length($src)); - $dst .= ' 'x(15-length($dst)); if (defined($color)) { - print colored ($message, $color); + printf(colored('%-9s', $color), $message); } else { - print $message; + printf('%-9s', $message); } - print "$src -> $dst\n"; + printf(" %-15s -> %-15s\n", $src, $dst); } __END__ |