Perl Array Efficiency Questions Answered
I was wondering if it’s safe to use a shift on an array in Perl? Wouldn’t Perl move all array items – taking just about forever on a large list?
The answer is- No. Explained in detail on perlmonks.
It turns out the shift function is efficient to use in perl- an O(1) operation.
Advertisement