Richard wrote:
what's wrong w/ this ?
I used (dot) . to indicate the maximum length of each element in the
print but last one does not print out in alinged format..
What am i missing?
use warnings;
use strict;
my $yabal = 'truncated';
my $never = 'sai';
my $noway = 'han1';
my %never = qw(hi how are you today fine i am good and
everyday12345678 never123456899999);
printf "%-.5s %-15s %-.2s\n", $yabal, $never, $noway;
for (keys %never) {
printf "%.2s %.10s\n", $_, $never{$_};
}
r...@myserver ~> ././yahoo2
trunc sai ha
hi how
go and
to fine
ar you
ev never12345
i am
I guess I was missing the 2.2 option.......
my %never = qw(hi how are you today fine i am good and everyday12345678
never123456899999);
for (keys %never) {
printf "%-2.2s %-10.10s\n", $_, $never{$_};
}
r...@myserver ~> ./!$
././yahoo2
trunc sai ha
hi how
go and
to fine
ar you
ev never12345
i am
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/