develooper Front page | perl.bootstrap | Postings from July 2000

Re: perl 6 requirements

Ted Ashton
July 31, 2000 11:41
Re: perl 6 requirements
Message ID:
Thus it was written in the epistle of Hildo Biersma,
> > This leads down the road to the "pack/unpack" scenario: really the primary
> > use for pack/unpack is to access/present data from/to type-checked,
> > non-scalar interfaces (structs, objects, arrays of X, whatever).
> Why?  Let perl do the work for you.  I known that perl will always be
> able to store an integer of any size in a normal untyped scalar.  If I
> want to store an arbitrary scalar, the language could define that (a) an
> out of range value is truncated or (b) an out of range value throws an
> exception.  If I want to cast everything, I would be coding C++ in the
> first place, you could in perl to get away from all that...

  P'raps you've not run across it, but there are situations where one is given
a datastructure created by another language (in my case, usually through being
handed a file with records built by a certain structure).  I have to unpack
those records, deal with the data, and likely pack up the data as a fixed-size
record to ship on to the next (non-Perl) thing.  If I could define a data
structure with fixed sizes and just say, "put the data in this space, here," it
would save my unpack and pack.


P.S.  And no, I really don't want to switch to C++, avoiding fixed data sizes
was not the only reason I switched to Perl :-).
Ted Ashton (, Info Sys, Southern Adventist University
For the things of this world cannot be made known without a knowledge of
                                       -- Bacon, Roger
         Deep thoughts to be found at Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About