develooper Front page | perl.perl5.porters | Postings from January 2012

Re: pack and ASCII

Thread Previous | Thread Next
Leon Timmermans
January 13, 2012 14:46
Re: pack and ASCII
Message ID:
On Fri, Jan 13, 2012 at 11:17 PM, Eric Brine <> wrote:
> No, encoding the output of C<pack> would produce garbage, e.g. C<< pack("N",
> 0x80112233) >> would return 5 bytes instead of 4.

I have no idea what you're talking about here. Can you please stop
interpreting anything anyone else says in the most unreasonable way

> Maybe you meanting encoding the input of C<< pack "A" >>, but that would
> break C<< pack("A20", $byte) >> and change C<< pack("A20", $text) >> in an
> incompatible way.

Well, obviously I didn't mean to encode bytes (why would anyone try
that?), and I don't see how encode breaks $text more than downgrading
would. And it's not like anyone still wants latin-1.

> hum? C<< pack "a" >> has always been very useful. It's used to build C
> structs and fixed-width records, for starters.

Obviously, I mean the behavior of «pack "a", $char»; I think I've been
quite explicit about liking its byte semantics. Is there any use case
for character semantics in that case? I can't think of it, at all.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About