Jeremy Muhlich wrote: > > Well you can't even assign a scalar to an @array to preallocate size, > the way you can assign to $#array. @array = 8 always creates an array > with a single element, namely 8. So I am pretty sure you're screwed > trying to make perl do what you want.
That's what I figured, but I wanted to check if there was some secret work around. > Maybe you couldjust *read* the > scalar value via $#array too, with the appropriate modification to > FETCHSIZE? I did an "odd" workaround. the bit vectors have their LSB start at index 1 instead of a more "natural" index zero. this: @arr1 = 42; will do a STORE to index 0, which I detect and change to a STORESIZE. I don't particularly like the fact that the indexes start at 1 instead of starting at ZERO, but at least I get a clean interface. I created a module on CPAN, Bit::Vector::Array use Bit::Vector::Array; bva(my @arr); # assigning to the entire array translates into assigning the integer # value of the vector. Here, it is assigned the value of 8. @arr=8; # 1000 binary # assigning to an index in the array translates to setting that bit # in the integer vector. $arr[3]=1; # 1100 binary # reading the array in scalar context returns the integer vector value. my [EMAIL PROTECTED]; # 12 decimal $arr[4]=0; # 0100 binary my [EMAIL PROTECTED]; # 4 decimal > Did you check out Tie::VecArray or Bit::Vector::Minimal ? T::VA is > pretty close to what you're trying to do, maybe you can use it instead. They're close, but they don't act like pure data arrays. both use method calls to get around the perl parsing limitation. I wanted a solution that looks like pure data. This is pretty much how it looks like in Verilog. The only limitation being that Verilog lets you have your LSB start at index zero or any otehr value. Here, I can use any index except zero. Greg _______________________________________________ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm

