From 65f28d4079bae82a4bb94890989358b0339f7a62 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 5 Apr 2009 11:58:12 +0200 Subject: checklinks: print_format: Use printf --- bin/checklinks | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'bin') 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 +## Copyright © 2008-2009 by Daniel Friesel ## License: 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__ -- cgit v1.2.3