APM: Just need structs

Montgomery Conner montgomery.conner at gmail.com
Thu Sep 13 20:55:10 PDT 2007


If you don't require encapsulation the easiest (and most efficient) solution
would be to forgo building an object to hold this data: there would be no
point and there is a semi-trivial amount of overhead in doing so.

You could use an array instead. Perl arrays are optimized and fast
(internally implemented as a C struct by the compiler), but because the
implementation of Perl variables is not strongly typed (like C) they will
dynamically accommodate a variety of data-types... so you'd likely only need
one type of container in Perl not three.

If you need to have a ternary grouping of similar data ( and if you
understand the use of anonymous data in Perl) you could use three arrays of
arrays, or an array of hashes (if you'd like named access to the data).

Or maybe I don't understand your intended use of this data...


Montgomery Conner


On 9/13/07, Tim McDaniel <tmcd at panix.com> wrote:
>
> On Thu, 13 Sep 2007, Jason Bodnar <jason at shakabuku.org> wrote:
> > http://search.cpan.org/~nwclark/perl-5.8.8/lib/Class/Struct.pm
> >
> > I've never used it but it looks like it's part of the perl dist.
>
> And it's even on the ancient RedHat Linux 9 box.  Thanks -- I'm
> checking it out now.
>
> --
> Tim McDaniel, tmcd at panix.com
> _______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/austin/attachments/20070913/2c23e572/attachment.html 


More information about the Austin mailing list