Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^4: mod_perl / Apache::Registry accidental closures

by rhesa (Vicar)
on Jul 21, 2006 at 19:13 UTC ( #562918=note: print w/ replies, xml ) Need Help??

in reply to Re^3: mod_perl / Apache::Registry accidental closures
in thread mod_perl / Apache::Registry accidental closures

Yes, I agree with you both (of course).

The tricky bit about just passing in the variables is that you'd need to redefine the interface of the sub (that is, return the modified values instead of editing in place). Which - for the people who stand to benefit the most from this Tutorial - might be a lot of work. If your script began with global variables in the first place, there's a good chance the rest of the program is procedural in nature.

imp, Your solution with passing by reference is even better than ikegami's, in that I expect it to be easier to understand.

Comment on Re^4: mod_perl / Apache::Registry accidental closures

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2015-11-25 02:36 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (668 votes), past polls