http://qs1969.pair.com?node_id=67344


in reply to is 'my' that much faster than 'local'?

A recent thread on the mod_perl mailing list covered precisely this topic (you might want to explore one of the archives pointed to from http://perl.apache.org/). The conclusion was roughly: my() doesn't make that much difference performance-wise. It can even be slightly slower in some cases (though benchmarking it truthfully is a pain).

However, do keep in mind that under mod_perl you want to avoid globals as much as possible. There'll be your plague, your worst nightmare. When you use globals, you have to be sure that they are all reset to their initial values at the end of your processing (unless you want to keep cross-request data, but that's the exception). Otherwise, you start seeing really weird stuff happening.

There's a lot in the Guide about this. You probably want to read that first.

-- darobin
  • Comment on Re: is 'my' that much faster than 'local'?