Re: Transparent packed C arrays
- From: Ilya Zakharevich <nospam-abuse@xxxxxxxxx>
- Date: Mon, 21 Nov 2005 23:00:18 +0000 (UTC)
[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
.
- Follow-Ups:
- Re: Transparent packed C arrays
- From: Tassilo v. Parseval
- Re: Transparent packed C arrays
- From: ~greg
- Re: Transparent packed C arrays
- References:
- Transparent packed C arrays
- From: Ilya Zakharevich
- Re: Transparent packed C arrays
- From: ~greg
- Transparent packed C arrays
- Prev by Date: using Net::SSH::Perl with Expect
- Next by Date: Please help me on the following perl program
- Previous by thread: Re: Transparent packed C arrays
- Next by thread: Re: Transparent packed C arrays
- Index(es):
Relevant Pages
|
|