Since these kind of questions always turn into a "let's see how many different alternatives we can come up with" contest, here's my entry:
for (@lines) { $_ = sprintf "%-6s", /(.{0,6})/; }
In reply to Re: Alternative to substr on unknown length of scalar
by revdiablo
in thread Alternative to substr on unknown length of scalar
by PerlingTheUK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |