Perl/Shell Knowledge Sharing
Perl Interview Questions and Answers
Sunday, January 2, 2011
Formating array file output using perl
#!/usr/bin/perl
my @num = (1..14);
for my $i (0 .. $#num) {
printf ("%-8d", $num[$i]);
print "\n" if (($i + 1) % 6 == 0);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment