in reply to (golf)String Concats or: playing with substr()
I wanted there to be a solution using write, but it won't pad out trailing whitespace for you. It could be done using right-justification, but I assume that's not what you want to do. On the other hand, if you're looking at multiple columns, it has merits (you can get around the padding problem, if you want to use read, but then you might as well use printf).
format FILE = @<<<<<<<<<@<<<<<<<<@<<<<<<<<< @foo . for my $line (@LoL) { @foo = @$line; write FILE; }
(The hacks to force a constant record length that I've come up with while writing this are either to right-justify the last field or put in a dummy field at the end with a useless character in it, btw--I'm sure there are others.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (golf)String Concats or: playing with substr()
by one4k4 (Hermit) on May 19, 2001 at 02:56 UTC |