Hello spudulike, and welcome to the Monastery!
Your first line, $line = pack ("A1170") ;, fills $line with a string of 1170 spaces. The next line, substr ($line, 0, 135) = " " ;, replaces the first 135 characters of $line with a single space, thereby shortening the string by 134 characters. Similarly, the next-to-last line shortens the string by a further 506 characters! What are those two lines intended to do?
I think you need to study the documentation for the substr function. :-)
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Google has failed me! Using pack and substr for fixed width file output
by Athanasius
in thread Google has failed me! Using pack and substr for fixed width file output
by spudulike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |