Re: Transparent packed C arrays



[A complimentary Cc of this posting was sent to
~greg
<g_m@xxxxxxxxxxxxxxxxxx>], who wrote in article <nIudnRHTA9vRrRzenZ2dnUVZ_tSdnZ2d@xxxxxxxxxxx>:

> Inline::Struct

I read the docs, but I see no advantage of Inline::Struct over

$value = unpack 'x[L170]L', $array;
substr $array, 170*4, 4, $value * 5;

I need something more Perlish, like

my $obj = ToPerl 'L*', pack 'L*', @vec;
print $obj->[170];
$obj *= 5;

$obj = $obj + $obj * $obj;

Etc.

> >I was under impression that there was a Perl module which allowed
> > "transparent" (via overloading) access to vectors represented as C
> > arrays, e.g., to
> >
> > $array = pack('L*',@vec);
> >
> > so that r/w access, arithmetic operations etc. work without explicit
> > unpack()ing. However, I could not find it quickly via CPAN search.

Ilya

.



Relevant Pages

  • Re: NETBeui of two adaptors
    ... [A complimentary Cc of this posting was sent to ... Ian Johnston ... Ilya ... Prev by Date: ...
    (comp.os.os2.setup.misc)
  • Re: How to emulate the Unix command "which"
    ... [A complimentary Cc of this posting was sent to ... > A quick way for a single command is: ... Ilya ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: What a fuckin mess
    ... > ynotssor wrote: ... >>>I'd still be posting it HERE! ... >> Just trying to save Greg the effort of going to ... Prev by Date: ...
    (rec.humor)
  • Re: Is this group still alive?
    ... Wayne Boatwright wrote: ... > Seems like posting has really slowed down starting on Friday. ... Greg ... Prev by Date: ...
    (rec.food.cooking)
  • Re: Blocking state of a Pipe
    ... [A complimentary Cc of this posting was sent to ... Mike Greene ... Ilya ... Prev by Date: ...
    (comp.os.os2.programmer.misc)