Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: is 'my' that much faster than 'local'?

by darobin (Monk)
on Mar 27, 2001 at 01:53 UTC ( #67344=note: print w/replies, xml ) Need Help??

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 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'?

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://67344]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2023-02-06 22:56 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (37 votes). Check out past polls.