develooper Front page | perl.perl5.porters | Postings from May 2013

Re: How on earth did we manage to break pack() so badly?

Thread Previous | Thread Next
From:
Peter Martini
Date:
May 1, 2013 16:10
Subject:
Re: How on earth did we manage to break pack() so badly?
Message ID:
CAFyW6MS_Y6ZYi6WF=zKjGMp1MERsmeFa+LBuu4zQdkOR4h9jeg@mail.gmail.com
On Wed, May 1, 2013 at 11:22 AM, Dave Mitchell <davem@iabyn.com> wrote:
>
> But that's just leaking the internal implementation details.
>

I thought that was the point of pack/unpack?  From the top of the docs
for pack: "Typically, each converted value looks like its
machine-level representation"

I understand the point being made that the internal format of the
string buffer is an implementation detail, but I'd think a better
default would be to pack that string buffer as asked rather than
convert it to something that is guaranteed to not be a machine-level
representation.

It seems a warning when trying to pack/unpack a string with the UTF
bit set (pointing to encode, etc) would make more sense than
converting the machine level representation to an idealized
representation.

Peter

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About