in reply to Re: Re: Re: adding null values to the start of an array
in thread adding null values to the start of an array

I'm not positive, but it's my impression that push, pop, shift, and unshift are all implemented as either thin wrappers around splice or thin wrappers around whatever underlies splice. So I think that the most possible difference is a single stack-frame (call unshift, and then unshift calls splice, as opposed to calling splice directly)... but I'm not even sure that that isn't optimized away (as, like, a macro or some such in the underlying C code). To know for sure, I'd have to dig through the C source for the perl core, which I don't really feel like doing right now. ;-)

------------
:Wq
Not an editor command: Wq
  • Comment on Re: Re: Re: Re: adding null values to the start of an array