
mhx
Enthusiast
/ Moderator
Sep 3, 2001, 11:11 AM
Post #2 of 2
(287 views)
|
|
Re: Binary x repitition operator
[In reply to]
|
Can't Post
|
|
Just wondering if I can: shift (@ResultPointer) x 3; # remove top 3 array rows 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
Useless use of repeat (x) in void context if run with -w.
or would splice(@ResultPointer, 0, 3); be more efficient? 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.
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. -- Marcus
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= ($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"
|