kurt_kober has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to use the write command to print a format to a file. Trouble is the trailing spaces are being truncated no matter what I do.
Example:
The output would be simply "Hi." ending at the dot, but I need it to be padded out to the full twenty spaces. How do you do this?? I figured this would be easy, but I can't find the answer.$test="Hi."; $~="TEST"; write; format TEST= @<<<<<<<<<<<<<<<<<<< $test .
Any help would be amazingly appreciated.
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Preserve trailing spaces with write format?
by tachyon (Chancellor) on Apr 17, 2002 at 18:40 UTC | |
|
Re: Preserve trailing spaces with write format?
by stephen (Priest) on Apr 17, 2002 at 18:42 UTC | |
by tachyon (Chancellor) on Apr 17, 2002 at 20:46 UTC | |
by synistar (Pilgrim) on Oct 24, 2011 at 13:39 UTC |