[root@mysql1 perl]# cat 28.pl
#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
my @items=qw( wilma dino pebbles );
my $format="the items are:\n".("%10s\n" x @items);
print my $x=@items,"\n";
printf $format,@items;
printf "the items are:\n".("%10s\n" x @items),@items;
[root@mysql1 perl]#
[root@mysql1 perl]#
[root@mysql1 perl]# ./28.pl
3
the items are:
wilma
dino
pebbles
the items are:
wilma
dino
pebbles
#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
my @items=qw( wilma dino pebbles );
my $format="the items are:\n".("%10s\n" x @items);
print my $x=@items,"\n";
printf $format,@items;
printf "the items are:\n".("%10s\n" x @items),@items;
[root@mysql1 perl]#
[root@mysql1 perl]#
[root@mysql1 perl]# ./28.pl
3
the items are:
wilma
dino
pebbles
the items are:
wilma
dino
pebbles