Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Data structure challenge

by bsb (Priest)
on Mar 22, 2004 at 23:34 UTC ( [id://338835]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://338835]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-24 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found