(broken, see update)
As for the documentation inconsistency, I'd bet its just a document error, as I've found file formats among the worst parts of documentation, which is often poor to begin with. The authors often don't expect many people to use these parts, so they don't get edited or updated properly. I would fire off an e-mail to the authors on the point though.my $header_format = 's'x50 . 'c'x150; read FILE, $line, length $header_format; my @header = unpack( $header_format, $line );
Hmm... if you use the 'a' template in place of the 'c' then I think you can avoid the map and chr in your join.
Update: Argh, posted too fast! This is broken... the length of the $header_format will only be the read length if we're dealing with 1-byte templates, and we aren't... oops!
--
I'd like to be able to assign to an luser
In reply to Re: read() and unpacking, data size issues
by Albannach
in thread read() and unpacking, data size issues
by Masem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |