Pad or truncate a string to a fixed length, $len, . . .
Padding is spaces; for ASCII NUL bytes use the 'a' or 'Z' format instead. 'Z' guarantees at least one NUL, for dealing with C strings.
$_ = pack 'A'.$len, $_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A Procrustean Statement
by ikegami (Patriarch) on Jun 16, 2006 at 05:01 UTC | |
by YuckFoo (Abbot) on Jun 16, 2006 at 17:21 UTC |