Hi, Edward,

You're right, PDL doesn't have a ulong type -- only a ushort.  Since  
your values aren't likely to be larger than 2**31, you are probably OK  
just using "long" rather than "ulong".   That might be the source of  
your readflex error, too; why not try it with "long" instead of "ulong"?

Cheers,
Craig


On Mar 8, 2009, at 10:22 PM, Hyer, Dr. Edward wrote:

> Hello PDL Wizards,
>
> Always embarrassed to ask easy questions, but I'm stumped.
>
> Trying to set up and read from a raw binary file (from someone else).
> File has a 64-item,unsigned-long header, which must be queried to find
> the start and dimensions of the data block. Cribbing directly from the
> FlexRaw docs, I did this:
>
> open(AREA,"<$file2");
> binmode(AREA)
> $head = readflex(AREA, [{NDims=>1, Dims=>[64], Type='ulong'}])
> $pixels=$head->(9)
> $lines=$head->(8)
> $datastart=$head->(33)
> seek(AREA,($pixels * $lines)+$datastart,0)
> $areadata = readflex(AREA, [{NDims=>2, Dims=>[$pixels,$lines],
> Type='byte'}])
> close(AREA);
>
> Two questions:
>
> 1) I can't get past the first readflex(), because of this error:
>
> Can't modify constant item in scalar assignment at (eval 119) line  
> 4, at
> EOF
>
> 2) Does PDL actually have a 'ulong' type? (32-bit unsigned)
>
> Thanks,
>
>
> --Edward H.
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to