Sep 3, 2001, 11:11 AM
Post #2 of 2
Re: Binary x repitition operator
[In reply to]
No. This would shift the first element off the array @ResultPointer, repeat it 3 times in string context and return a string that isn't used. Perl would yield
Just wondering if I can:
shift (@ResultPointer) x 3; # remove top 3 array rows
if run with -w.
Useless use of repeat (x) in void context
I think it's the most efficient way. Using three shifts wouldn't be as efficient. splice is about 40 percent faster in this case.
splice(@ResultPointer, 0, 3);
be more efficient?
Would there be a problem with either method if the array contained only 3 elements?No, except for the fact that the first method wouldn't work for the above reason.
Hope this helps.