# The following was supposedly scribed by
# Sisyphus
# on Monday 20 June 2005 05:24 am:
>> Not really an Inline question :-)
>
>I was hoping you wouldn't notice - and at least it's a perl question
Is it? It seems like it would be better to use Inline than unpack().
Rob,
Could you tie() it? (What you've got is almost a blessed object (just
uc(destroy). and bless in init()) Then your accessor methods would all
be perlish. (that would be great for the cookbook!)
>I already have
>the XS routines to access those structures individually, and I was
> hoping to use those routines on the structures "contained" in these
> "array objects".
This makes me think you should you be just using a perl array of those
objects.
sub new {
my $class = shift;
my $self = [];
for(0..$_[0]) {
push(@$self, Thingy->new($_));
}
bless($self, $class);
return($self);
}
Even if you were wanting some speed from handling the array in C
somewhere, I would still make it a perl array unless your hands are
tied by an external library (and then I would tie it and pretend the
whole thing never happened.)
--Eric
--
"Everything should be made as simple as possible, but no simpler."
--Albert Einstein
---------------------------------------------
http://scratchcomputing.com
---------------------------------------------