Tie::Array::PackedC 0.03 review

Download
by rbytes.net on

Tie::Array::PackedC is a tie a Perl array to a C-style array (packed; elements of a single, simple data type). SYNOPSIS use T

License: Perl Artistic License
File size: 6K
Developer: demerphq
0 stars award from rbytes.net

Tie::Array::PackedC is a tie a Perl array to a C-style array (packed; elements of a single, simple data type).

SYNOPSIS

use Tie::Array::PackedC qw(packed_array packed_array_string);
my $ref=packed_array(1,2,3,4);
my $ref2=packed_array_string(my $s,1,2,3,4);

use Tie::Array::PackedC Double=>'d';
tie my @array,'Tie::Array::PackedC::Double',1..10;
$array[0]=1.141;

Provides a perl array interface into a string containing a C style array. In other words the string is equivelent to the string that would be returned from the equivelent pack command (defaulting to pack type "l!") using a normal array of the same values. Eg:

my @foo=(1..10);
my $string=pack "l!*",@foo;

leaves $string in basically the same condition as

my (@foo,$string);
tie @foo,'Tie::Array::PackedC',$string,1..10;

Its only basically the same and not exactly the same because the tie version may be longer due to preallocation.

Requirements:
Perl

Tie::Array::PackedC 0.03 keywords