Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: I need perl coding standardsby siracusa (Friar) |
on May 29, 2005 at 00:47 UTC ( [id://461433]=note: print w/replies, xml ) | Need Help?? |
I found this bit odd:
Do not use shift. Use @_. shift is slower, and Brian has an allergic reaction to it. I always use shift, and I recall benchmarking it way back in the day before I made that decision, just to make sure it wasn't slower. Here's the test I used, and the results:
Seeing the flat claim that shift is slower made me rethink my earlier test and try something more simple: Sure enough, the results changed, but now it appears to be a tie:
The results fluctuate a few percent in each direction. Anyway, my point is that I don't think performance is a reason to avoid using shift. (I have a whole directory of benchmarks for silly little things, e.g. benchmarking exists() vs. a test for truth on a hash key and crazy stuff like that. It's a disease...but it amuses me :-)
In Section
Seekers of Perl Wisdom
|
|