- or download this
@x = (1,2,3,4,5,6);
print STDOUT join(" ", map { sprintf "%7d", $_ } @x), "\n";
#outputs:
1 2 3 4 5 6
- or download this
@x = (123456);
print STDOUT join(" ", map { sprintf "%7d", $_ } map { split //, $_ }
+@x), "\n";
#outputs:
1 2 3 4 5 6
- or download this
my @x = (1,2,3,4,5,6);
my @new;
...
#outputs:
1 2 3 4 5 6