in reply to Data structure challenge

Does $#A = $#B = U initialize the arrays correctly?

Brad

Replies are listed 'Best First'.
Re: Data structure challenge
by Abigail-II (Bishop) on Mar 22, 2004 at 23:50 UTC
    Yes, Perl has to initialize all array elements. Internally, it will store pointers (to SV's), and if Perl wouldn't initialize the array elements, it ends up with random memory addresses, and it has no way of finding out whether the element was initialized or not.

    Abigail

      As I thought about it, I began to suspect that.

      XS of course doesn't count.
      Does this cover virtually programming in C via syscall(&SYS_mmap,..) and pack-ing data structures?

      Otherwise, I give up. In fact, I give up anyway, I'm not going near syscall.